Capture the GCLID in Salesforce and return it to Google Ads
If Google Ads brings in leads but you cannot see which clicks become customers, spend decisions are guesswork. Storing the GCLID with each Salesforce lead, then returning it as an offline conversion, connects ad clicks to later pipeline outcomes.
Why the GCLID matters
Google Ads can generate enquiries, but clicks alone do not show whether those enquiries become paying customers. The GCLID is the click identifier that lets a later CRM outcome be matched back to the originating ad click. Capturing it on the lead record is the first link in that chain; sending it back as an offline conversion completes it.
Four steps to store the GCLID on every Salesforce lead
- Install the capture snippet on the website, through site settings or a tag manager, and add a hidden field named for the GCLID to each lead form. 2. On first arrival from a Google Ads click, the tool reads the GCLID from the URL and stores it in the visitor's browser. 3. When the visitor later submits any form, the tool writes the stored value into the hidden field, so it travels with the name, email and phone already entered. 4. Pass the submitted value into Salesforce through the form builder's native integration or an integration tool such as Zapier or Make. Checklist before go-live: snippet present on all entry pages, hidden field on every lead form, a test submission visible in Salesforce, and the field mapped correctly in the integration.
Send the GCLID back as an offline conversion
In Google Ads, open Goals, then Conversions, add a new conversion and choose Offline Conversion. When asked for a data source, select the option to add it later. Next, decide which pipeline event counts as the conversion. Sending only closed deals is the cleanest definition, but the smart bidding strategies named here need at least 50 conversions per month to work effectively, so a lower-volume business may track an earlier event such as Opportunity creation. Build the automation with that event as the trigger, choose Google Ads Send Offline Conversion as the action, and map the stored GCLID to the matching field. Test end to end before increasing spend.
Why browser storage beats reading the URL at submission
Many form tools read parameters from the URL at the moment of submission. If a visitor lands on the homepage from an ad and then moves to the contact page, the identifier is no longer in the URL and is lost. Browser storage solves this: the value from the first visit survives browsing, leaving and returning. The same mechanism can carry UTM parameters behind paid campaigns and channel detail for organic search, organic social, referral and direct traffic, so Salesforce shows where all leads came from, not only paid clicks.
Worked example: reading the attribution fields in Salesforce
For a paid search lead, the CRM record might show Channel = Paid Search, Channel Drilldown 1 = Google, Channel Drilldown 2 = the campaign name, Channel Drilldown 3 = the keyword, and Channel Drilldown 4 = the ad clicked. For an organic lead, it might show Channel = Organic Search, Channel Drilldown 1 = Google, Channel Drilldown 2 = the search engine domain, and Channel Drilldown 3 = the searched keyword when available. Use these fields to compare campaign, keyword and ad performance against pipeline outcomes rather than clicks alone.
| Field | Paid search example | Organic search example |
|---|---|---|
| Channel | Paid Search | Organic Search |
| Channel Drilldown 1 | ||
| Channel Drilldown 2 | Campaign name | Search engine domain |
| Channel Drilldown 3 | Keyword bid on | Keyword searched, when available |
| Channel Drilldown 4 | Ad clicked | Not applicable |
Illustrative values from the captured example; actual values depend on UTM parameters and search data available.
| Check | Pass looks like |
|---|---|
| Snippet installed | Capture code loads on website entry pages |
| Hidden field present | GCLID field exists on every lead form |
| Test submission | GCLID value appears in Salesforce with the lead |
| Offline conversion | Google Ads conversion created with data source added later |
| Automation mapping | Stored GCLID maps to the Send Offline Conversion field |
Pre-launch checklist derived from the described workflow; test in your own account before relying on the data.
Frequently asked questions
Why does a GCLID disappear before the form is submitted?
A form tool that only reads the current URL will miss the identifier if the visitor browses to another page before submitting. Storing the identifier in the browser on first arrival preserves it across pages and return visits, so it can be written into the form at submission.
What is the order for sending a stored GCLID back to Google Ads?
Create an offline conversion in Google Ads first, choosing to add the data source later. Then connect the chosen Salesforce event to Google Ads Send Offline Conversion and map the stored GCLID to the correct field. Test the flow before relying on it for bidding.
Should the offline conversion be sent only when a deal closes?
Waiting for closed deals is conceptually clean, but smart bidding strategies described here need at least 50 conversions per month. If closed deals are fewer, tracking an earlier pipeline stage such as Opportunity creation can provide more data for optimisation.
Can the same setup capture more than the GCLID?
Yes. The same hidden-field approach can also carry UTM parameters for paid campaigns and channel information for organic search, organic social, referral and direct visits, giving a fuller picture of lead origin in the CRM record.