On this page
What this issue is
The gclid is a parameter Google Ads adds to your landing page URL when auto-tagging is on, for example ?gclid=Cj0KCQ.... It identifies the exact ad click. To use it later, you have to save it when the visitor submits a form.
Why it costs you leads or sales
Many leads turn into customers days or weeks after the click, often by phone or in your CRM. Google Ads only learns about those sales if you upload them with the original gclid. If the gclid is missing, you cannot upload them.
Smart Bidding then optimises for form fills only, including low-quality ones, instead of the leads that become revenue. You also cannot see which campaigns and keywords bring paying customers, so budget can go to the wrong place.
- Ad clickURL carries ?gclid=...
- Landing pagegclid is in the address bar
- Form submitHidden gclid field empty or missing
- CRM recordNo gclid on the lead
- Offline importSale cannot be matched to the click
The click is tracked, but the value never reaches the CRM, so the sale cannot be sent back to Google Ads.
Example: numbers are illustrative, not measured. Capturing the gclid on every page lifts the share of leads you can send back to Google Ads.
How to check if your site has it
Open your landing page with a test gclid
Visit https://yoursite.com/landing-page/?gclid=TEST123 in a private window.
Inspect the form
Right-click the form, choose Inspect, and search for an input named gclid. Check that its value is TEST123.
Browse to another page first
Click to a second page, then open the form. If the field is now empty, you are not storing the value in a cookie.
Submit a test lead
Use a clearly fake name and email, then open the new record in your CRM and look for TEST123.
- Your CRM has no gclid or Google click ID field
- The gclid field exists but is blank on Google Ads leads
- Offline conversion imports report unmatched or missing click IDs
- The gclid is present on the landing page but gone on the second page
- Form builder entries show the visible fields but no gclid
How to fix it
The fix has three parts: save the gclid when the visitor lands, put it in a hidden field on every form, and map that field to a CRM property. Start with the script, then follow your platform.
(function () {
var params = new URLSearchParams(window.location.search);
var gclid = params.get('gclid');
if (gclid) {
var expires = new Date(Date.now() + 90 * 864e5).toUTCString();
document.cookie = 'gclid=' + encodeURIComponent(gclid) + '; expires=' + expires + '; path=/; SameSite=Lax';
}
function readCookie(name) {
var m = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
return m ? decodeURIComponent(m[1]) : '';
}
function fill() {
var value = readCookie('gclid');
if (!value) return;
document.querySelectorAll('input[name="gclid"]').forEach(function (el) {
el.value = value;
});
}
document.addEventListener('DOMContentLoaded', fill);
window.addEventListener('load', fill);
})();Add a hidden field
In Gravity Forms, Contact Form 7, WPForms or Fluent Forms, add a hidden field. Name or parameter name it gclid. In Gravity Forms, tick Allow field to be populated dynamically and set the parameter name to gclid.
Add the script
Paste the script above into a header/footer plugin or your theme, so it runs on every page.
Map to your CRM
In the form's CRM or webhook feed, map the gclid field to your CRM property.
Create the tag
Add a Custom HTML tag containing the script above, wrapped in script tags. Trigger it on All Pages (after consent where required).
Publish and preview
Use Preview mode with ?gclid=TEST123 and confirm the cookie and the field value.
Add a hidden field
In the form or survey builder, add a Hidden Field element and set its query key to gclid. Save it to a custom field, for example Google Click ID.
Keep it across pages
If the form sits on a later page, add the script in the funnel's tracking code so the cookie value is reused.
Add the input
Add an Input in the form, set its Name to gclid, and hide it with a custom class using display: none.
Add the script
Paste the script above into Project Settings, Custom Code, Footer. Publish the site.
Add the field to the form
In your theme's contact or lead form Liquid file, add an input type hidden named gclid. For checkouts, save the value as a cart attribute instead.
Add the script
Add the script to theme.liquid before the closing body tag.
Add the field
Add <input type="hidden" name="gclid" value=""> inside each form.
Save it server-side
Read the gclid field in your form handler and store it in a database column or send it to your CRM API.
Create a CRM field
Add a text property called gclid (or Google Click ID) on leads or contacts. Make sure its length allows long values.
Map the form field
Connect the form's gclid field to that property in the integration, Zap, webhook or native sync.
Keep gbraid and wbraid too
For iOS traffic, Google may send gbraid or wbraid instead. Store these in extra fields the same way.
Do not overwrite on later visits
Keep the first gclid for the lead unless a newer ad click arrives.
Before
- Form has name, email, phone only
- CRM lead has no click ID
- Offline import finds no matches
After
- Hidden gclid field filled from URL or cookie
- CRM lead stores the gclid
- Closed deals can be uploaded to Google Ads
How to confirm it's fixed
Repeat the test
Visit the landing page with ?gclid=TEST123, move to another page, and submit the form.
Check the form entry
Open the entry in your form tool and confirm gclid shows TEST123.
Check the CRM
Confirm the CRM lead has TEST123 in the mapped field.
Test a real click
Later, check a genuine Google Ads lead for a long gclid starting with letters such as Cj or EAIa.
How to prevent it happening again
- Re-test after every form, theme, plugin or CRM change
- Add the hidden field to every new form, not just the main one
- Check redirects keep the gclid in the URL
- Keep auto-tagging on in Google Ads
- Review the share of Google Ads leads with a gclid each month
No gclid field
Leads or data lost
Leads reach the CRM without a click ID, so offline conversions cannot be matched to Google Ads.
Toggle the cause to see what happens to your lead data.
How FunnelGuard handles this
FunnelGuard detects this issue today. A robot visitor opens your landing page with a Google Ads style gclid, fills in and submits your lead form on a schedule, and checks that the submission payload contains the gclid. If it is missing, you get one alert after a re-check from a second region, with a screenshot and a likely cause.
Questions people ask
Why is my gclid not showing in my CRM?
Usually the form has no hidden gclid field, the field is not filled by a script, or the CRM field is not mapped. Test with ?gclid=TEST123 on the landing page and trace the value from the form entry into the CRM to find where it drops.
How do I capture the gclid in a hidden form field?
Add a hidden input named gclid to your form. Use a small script that reads the gclid from the URL, saves it in a cookie, and fills the field. Then map that field to a CRM property.
Do I need to store the gclid in a cookie?
Yes, if visitors may browse to other pages before submitting. The gclid only appears in the URL on the landing page, so a cookie lets you fill the hidden field later.
What is the gclid used for after I save it?
It lets you upload offline conversions, such as qualified leads or closed sales, to Google Ads. Google matches each one to the original click and uses it for reporting and bidding.
Why does the gclid field stay empty on my form?
The script may run before the form loads, the field name may not match, or a redirect or cookie banner reload may remove the gclid from the URL. Check that the input name is exactly gclid and that the script runs on load.
Should I also store gbraid and wbraid?
Yes. On some iOS traffic Google sends gbraid or wbraid instead of gclid. Storing them in separate fields lets you use them for conversion imports too.
How can I test if my form saves the gclid?
Open the landing page with ?gclid=TEST123 in a private window, submit a test lead, and look for TEST123 in the form entry and the CRM. A monitoring tool such as FunnelGuard can repeat this check on a schedule.
Related issues
- TRK-143_gcl_aw cookie not set after gclid landingFix guide
- TRK-144gclid stripped by redirect to www / httpsFix guide
- TRK-145gclid stripped by trailing-slash or language redirectFix guide
- TRK-146gclid stripped by cookie banner reloadFix guide
- TRK-149Auto-tagging off in Google Ads (no gclid on clicks)Fix guide
- TRK-159Offline conversion import failing (gclid mismatch, timing)Fix guide