Zoho CRM + Google Ads: Track Ad Spend to Closed Revenue

Amit Prabhu Amit Prabhu · Jun 2, 2026 · 16 min read #CRM Integration #Google Ads #Offline Conversions
Zoho CRM + Google Ads: Track Ad Spend to Closed Revenue

Most Google Ads accounts optimise for form fills or phone calls. Those are proxies. The metric that actually matters is closed revenue, and it lives inside your CRM, not inside Google Ads. When your Zoho CRM Google Ads integration is working correctly, Google’s bidding algorithms receive deal-stage signals and start allocating budget toward the traffic patterns that actually close, not just the ones that fill out a form.

This guide walks through the complete technical setup: capturing the Google Click ID (GCLID) at lead entry, storing it in Zoho CRM, firing a webhook when a deal closes, calling the Google Ads API to import the offline conversion, and verifying that the data arrives cleanly. By the end you will have a closed-loop attribution system where every dollar of ad spend can be traced to a closed-won deal.

crm revenue tracking dashboard

Why Offline Conversion Import Changes Campaign Performance

Google Ads can observe what happens on your website. It cannot observe what happens inside your CRM. Without offline conversion import, the platform sees a lead form submission and calls that a success. With it, you can tell Google exactly which clicks became paying customers, at what deal value, and after how many days in the pipeline.

This has three practical effects on campaign performance:

Architecture Overview: How the Data Flows

Before writing any code, map the full data path. There are five stages:

  1. Click capture: A visitor clicks a Google ad. Google appends a gclid parameter to the landing page URL.
  2. GCLID storage: Your landing page JavaScript reads the parameter and writes it into a hidden form field. When the visitor submits the form, the GCLID is stored on the Zoho CRM Lead record.
  3. Deal progression: The lead is qualified, converted to a Contact and Deal, and works through your pipeline stages. The GCLID travels with the record.
  4. Conversion trigger: When the Deal stage changes to Closed Won, a Zoho CRM workflow fires a webhook to a serverless function or directly calls the Google Ads API.
  5. Conversion import: The Google Ads API receives the GCLID, conversion name, conversion time, and optionally the deal value, and credits the originating click.

This architecture mirrors the approach used in Facebook Ads integration with Zoho, where CRM deal data flows back to the ad platform to close the attribution loop.

Step 1: Capture and Store the GCLID in Zoho CRM

Create a GCLID field in Zoho CRM

Navigate to Setup > Modules and Fields > Leads. Add a new single-line text field named Google Click ID with the API name GCLID. Set it to read-only in the layout so sales reps cannot accidentally overwrite it. Repeat this for the Contacts and Deals modules, as the value needs to travel when a Lead is converted.

Add the JavaScript snippet to your landing pages

On every page that hosts a Zoho web-to-lead form, add this script before the closing </body> tag:

(function() {
  function getParam(name) {
    var url = window.location.href;
    name = name.replace(/[\[\]]/g, '\$&');
    var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');
    var results = regex.exec(url);
    if (!results) return null;
    if (!results[2]) return '';
    return decodeURIComponent(results[2].replace(/\+/g, ' '));
  }

  var gclid = getParam('gclid');
  if (gclid) {
    sessionStorage.setItem('gclid', gclid);
  }

  var storedGclid = sessionStorage.getItem('gclid');
  if (storedGclid) {
    var fields = document.querySelectorAll('input[name="GCLID"]');
    fields.forEach(function(f) { f.value = storedGclid; });
  }
})();

Using sessionStorage means the GCLID persists if a visitor browses multiple pages before converting. If your sales cycle involves returning visitors across sessions, switch to a cookie with a 90-day expiry to match Google’s conversion window.

Verify GCLID capture in Zoho CRM

Append ?gclid=TEST_GCLID_VALUE to your landing page URL, complete the form, and confirm the Lead record in Zoho CRM shows the GCLID field populated with TEST_GCLID_VALUE. Do not proceed to later steps until this works reliably.

google ads campaign analytics

Step 2: Configure Google Ads Offline Conversion Action

In Google Ads, go to Tools and Settings > Measurement > Conversions. Click the plus icon and select “Import.” Choose “CRMs, files, or other data sources,” then “Track conversions from clicks.” Name the conversion action something descriptive such as Zoho CRM Closed Won.

Key settings to configure:

SettingRecommended valueNotes
CategoryPurchaseSignals revenue intent to Smart Bidding
ValueUse different values for each conversionAllows deal value to influence ROAS bidding
CountOneCounts each closed deal once
Click-through conversion window90 daysMatches maximum GCLID validity
Attribution modelData-driven (or Time decay)Data-driven requires 300+ conversions/month
Include in ConversionsYesFeeds Smart Bidding signals

After saving, note the Conversion ID and Conversion Label from the conversion tag detail page. You will need both when calling the API.

Step 3: Set Up the Google Ads API Connection

Create a Google Ads API developer token

Apply for a developer token at developers.google.com/google-ads/api/docs/get-started/dev-token. For production use you need an approved token; for testing, use the test account environment. You will also need OAuth 2.0 credentials (client ID and client secret) from Google Cloud Console, with the Google Ads API enabled.

Generate a refresh token

Run the OAuth 2.0 flow once using the Google Ads API client library to generate a refresh token. Store the following four values securely, ideally in Zoho Vault or as encrypted custom fields in a configuration record:

Step 4: Build the Zoho CRM Workflow and Deluge Function

Create the workflow trigger

In Zoho CRM, go to Setup > Automation > Workflow Rules. Create a new rule for the Deals module with these conditions:

The second condition prevents API calls for deals that did not originate from Google Ads, which saves API quota and avoids error noise in your logs. This is similar in structure to the Zoho CRM automation workflows pattern used for post-close notifications and onboarding triggers.

Write the Deluge function

Add a custom function action to the workflow. The function must: exchange the refresh token for an access token, construct the conversion upload payload, and POST it to the Google Ads API.

// Zoho CRM Deluge - Import Offline Conversion to Google Ads
deal = zoho.crm.getRecordById("Deals", input.get("deal_id").toLong());

gclid = deal.get("GCLID");
dealValue = deal.get("Amount").toDecimal();
closedDate = deal.get("Closing_Date").toString("yyyy-MM-dd");

if(gclid == null || gclid == "") {
  return "No GCLID on deal - skipping";
}

// Step 1: Exchange refresh token for access token
tokenPayload = Map();
tokenPayload.put("client_id", "YOUR_CLIENT_ID");
tokenPayload.put("client_secret", "YOUR_CLIENT_SECRET");
tokenPayload.put("refresh_token", "YOUR_REFRESH_TOKEN");
tokenPayload.put("grant_type", "refresh_token");

tokenResponse = invokeurl
[
  url: "https://oauth2.googleapis.com/token"
  type: POST
  parameters: tokenPayload
];

accessToken = tokenResponse.get("access_token");

if(accessToken == null) {
  return "Token exchange failed: " + tokenResponse.toString();
}

// Step 2: Build conversion upload request
conversionTime = closedDate + " 12:00:00+00:00";

conversionData = Map();
conversionData.put("gclid", gclid);
conversionData.put("conversion_action", "customers/YOUR_CUSTOMER_ID/conversionActions/YOUR_CONVERSION_ID");
conversionData.put("conversion_date_time", conversionTime);
conversionData.put("conversion_value", dealValue);
conversionData.put("currency_code", "USD");

conversionsWrapper = Map();
conversionsWrapper.put("conversions", List(conversionData));
conversionsWrapper.put("partial_failure", true);
conversionsWrapper.put("validate_only", false);

headers = Map();
headers.put("Authorization", "Bearer " + accessToken);
headers.put("developer-token", "YOUR_DEVELOPER_TOKEN");
headers.put("Content-Type", "application/json");

apiUrl = "https://googleads.googleapis.com/v16/customers/YOUR_CUSTOMER_ID:uploadClickConversions";

apiResponse = invokeurl
[
  url: apiUrl
  type: POST
  parameters: conversionsWrapper.toString()
  headers: headers
];

// Step 3: Log result
responseStr = apiResponse.toString();

if(apiResponse.containsKey("partialFailureError")) {
  errorMsg = "Partial failure: " + apiResponse.get("partialFailureError").toString();
  // Log to a custom Zoho CRM note or error log record
  noteData = Map();
  noteData.put("Note_Title", "Google Ads Conversion Upload Error");
  noteData.put("Note_Content", errorMsg + " | GCLID: " + gclid);
  noteData.put("Parent_Id", input.get("deal_id"));
  noteData.put("se_module", "Deals");
  zoho.crm.createRecord("Notes", noteData);
  return errorMsg;
}

// Log success
successNote = Map();
successNote.put("Note_Title", "Google Ads Conversion Uploaded");
successNote.put("Note_Content", "GCLID: " + gclid + " | Value: $" + dealValue + " | Response: " + responseStr);
successNote.put("Parent_Id", input.get("deal_id"));
successNote.put("se_module", "Deals");
zoho.crm.createRecord("Notes", successNote);

return "Success: " + responseStr;

Replace the placeholder values (YOUR_CLIENT_ID, YOUR_CUSTOMER_ID, etc.) with your actual credentials before deploying. The conversion_action path requires the numeric conversion action ID, which you can retrieve from the Google Ads API or from the URL when viewing the conversion action in the UI.

Handle the conversion_date_time format requirement

Google Ads requires the conversion timestamp in the format yyyy-MM-dd HH:mm:ss+HH:mm. The timezone offset must match the timezone configured on your Google Ads account. If your account is set to UTC, use +00:00. If it is set to US Eastern time, use -05:00 or -04:00 depending on daylight saving. Mismatched timezones cause silent failures where the conversion is rejected without a clear error code.

sales pipeline conversion data

Step 5: Map Campaign and Ad Group Data to CRM Fields

The GCLID alone gives you attribution at the click level. To analyse performance by campaign or ad group in Zoho CRM or sales forecasting reports, you need to pass additional UTM parameters from the ad URL into CRM fields.

Set up auto-tagging in Google Ads (it is enabled by default for most accounts) and also add UTM parameters to your final URLs:

https://yourdomain.com/landing-page?utm_source=google&utm_medium=cpc&utm_campaign={campaign}&utm_content={adgroupid}&utm_term={keyword}

Create corresponding fields in Zoho CRM Leads:

CRM FieldAPI NameSource
Google Click IDGCLIDgclid URL parameter
UTM SourceUTM_Sourceutm_source URL parameter
UTM MediumUTM_Mediumutm_medium URL parameter
UTM CampaignUTM_Campaignutm_campaign URL parameter
UTM ContentUTM_Contentutm_content URL parameter (ad group ID)
UTM TermUTM_Termutm_term URL parameter (keyword)
Lead Source DetailLead_Source_DetailPopulated from UTM Campaign

Extend the landing page JavaScript to capture and store all six parameters, then populate all six hidden form fields. This turns Zoho CRM into a revenue attribution database where you can filter deals by campaign and calculate actual revenue per campaign without leaving the CRM.

Step 6: Error Handling and Retry Logic

Offline conversion uploads fail silently more often than they should. Build explicit error handling at three levels:

API-level errors

The Google Ads API returns partial failure errors as a partialFailureError key in the response. Common failure codes include:

Token expiry handling

Access tokens from the token exchange expire after one hour. Since the Deluge function exchanges a fresh token on every invocation, this is not a concern for the workflow trigger. However, if you batch-upload historical conversions, add a check that re-exchanges the token every 50 minutes.

Audit log in Zoho CRM

The Deluge function above creates a Note on the Deal record for both success and failure cases. For higher-volume accounts, create a dedicated custom module called Ad Conversion Logs with fields for Deal ID, GCLID, Upload Status, API Response, and Timestamp. This gives your marketing team a queryable audit trail without cluttering the Notes tab.

Step 7: Verify the Integration with Tag Assistant and Diagnostics

Test with a real GCLID

Do not test with fabricated GCLID strings. Google validates GCLID format and rejects synthetic values with a clear error code, but some valid-format test GCLIDs may appear to succeed in test mode and fail in production. Instead:

  1. Click one of your own Google Ads from a test search (use a private browser window and search the keyword your ad targets).
  2. Copy the GCLID from the landing page URL.
  3. Submit the form manually to create a Lead record in Zoho CRM with that real GCLID.
  4. Convert the Lead to a Deal and immediately move it to Closed Won to trigger the workflow.
  5. Check the Deal’s Notes for a success message from the Deluge function.

Verify in Google Ads

In Google Ads, go to Tools and Settings > Measurement > Conversions and open the Zoho CRM Closed Won conversion action. Within 3 to 24 hours, you should see the conversion counted. The status column changes from “Recording conversions” to showing actual conversion data. If it shows “No recent conversions” after 24 hours, check the audit log in Zoho CRM for API error codes.

Use the Google Ads offline conversion diagnostic tool

Under Tools and Settings > Measurement > Conversions, select your offline conversion action and click “Diagnostics.” This shows the upload rate, error rate, and specific error codes for the last 30 days of uploads. Aim for an upload rate above 95% before relying on this data for bid strategy decisions.

Optimising Campaigns After the Integration is Live

Once offline conversions are flowing and Google Ads has accumulated at least two to four weeks of data, you can shift bid strategies:

For a full overview of all available options, explore our complete guide to Zoho integrations.

Frequently Asked Questions

Can Zoho CRM send offline conversions to Google Ads?

Yes. Using Zoho CRM workflows combined with a Deluge custom function and the Google Ads API, you can push deal-closed events as offline conversions. The key requirement is capturing the GCLID at lead creation and passing it back when the deal stage changes to Closed Won. The conversion data typically appears in Google Ads within 3 to 24 hours of upload.

How do I capture the GCLID in Zoho CRM?

Add a hidden GCLID text field to your Zoho CRM web-to-lead form. Place a JavaScript snippet on your landing page that reads the gclid URL parameter (which Google Ads appends automatically when auto-tagging is enabled) and writes it into the hidden field. When the visitor submits the form, the GCLID is stored on the Lead record and can be carried forward to the Deal record on conversion.

How long does it take for imported conversions to appear in Google Ads?

Uploaded offline conversions typically appear in Google Ads within 3 hours of upload, though it can take up to 24 hours. Note that conversions older than 90 days from the original click cannot be imported at all, so it is important to upload promptly after deal close. Conversions uploaded within 48 hours of the click tend to have better attribution accuracy in reporting.

Which attribution model works best with Zoho CRM offline conversions?

Data-driven attribution is the recommended model when you have sufficient volume, specifically more than 300 conversions in the past 30 days across your account. For smaller accounts, time decay attribution gives more credit to the recent touchpoints that influenced the final sale, which tends to reflect B2B buying behavior more accurately than last-click. Whichever model you use, apply it consistently and allow at least 30 days before drawing conclusions.

Does this integration work with Zoho Marketing Automation?

Zoho Marketing Automation can track ad clicks and sync lead source data to CRM as part of its journey tracking. However, for offline conversion import to Google Ads, you still need a direct CRM-to-Google Ads API connection, either through the Deluge workflow approach described in this guide or via Zoho Flow with a Google Ads connector. Zoho Marketing Automation does not natively push conversion events to the Google Ads offline conversions API.

Want help connecting your Zoho CRM to Google Ads? Our Zoho-certified team builds and maintains the integration for you.

Talk to Our Team
Share this article LinkedIn Twitter / X
# CRM Integration # Google Ads # Offline Conversions # PPC # Zoho CRM

Thinking about Zoho or NetSuite?

Our team builds systems that actually work. No fluff, just honest architecture and clean implementation.