Skip to content
FunnelGuard

Fix guide by FunnelsGuard

gclid not stored in hidden form field or CRM: how to fix it

TRK-148High impactDetectedBy FunnelGuardPublished Updated
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.

Where the gclid gets lost
  1. Ad clickURL carries ?gclid=...
  2. Landing pagegclid is in the address bar
  3. Form submitHidden gclid field empty or missing
  4. CRM recordNo gclid on the lead
  5. 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.

Leads with a usable gclidExample numbers
Leads with a usable gclid (example)No hidden field: 0 % of Google Ads leads; Field on form page only: 35 % of Google Ads leads; Field plus cookie: 90 % of Google Ads leads0346903590No hidden fieldField on form page on…Field plus cookie% of Google Ads leads

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

Test it yourself in five minutes
  1. Open your landing page with a test gclid

    Visit https://yoursite.com/landing-page/?gclid=TEST123 in a private window.

  2. Inspect the form

    Right-click the form, choose Inspect, and search for an input named gclid. Check that its value is TEST123.

  3. 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.

  4. Submit a test lead

    Use a clearly fake name and email, then open the new record in your CRM and look for TEST123.

Signs the gclid is not being stored
  • 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.

Save the gclid and fill hidden fieldsjavascript
(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 the hidden field on your platform
  1. 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.

  2. Add the script

    Paste the script above into a header/footer plugin or your theme, so it runs on every page.

  3. Map to your CRM

    In the form's CRM or webhook feed, map the gclid field to your CRM property.

Finish the setup
  1. 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.

  2. Map the form field

    Connect the form's gclid field to that property in the integration, Zap, webhook or native sync.

  3. Keep gbraid and wbraid too

    For iOS traffic, Google may send gbraid or wbraid instead. Store these in extra fields the same way.

  4. Do not overwrite on later visits

    Keep the first gclid for the lead unless a newer ad click arrives.

Lead record before and after

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

Verify end to end
  1. Repeat the test

    Visit the landing page with ?gclid=TEST123, move to another page, and submit the form.

  2. Check the form entry

    Open the entry in your form tool and confirm gclid shows TEST123.

  3. Check the CRM

    Confirm the CRM lead has TEST123 in the mapped field.

  4. 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

Keep gclid capture healthy
  • 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
Hidden gclid fieldInteractive
Form has no working gclid field

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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: payload_contains gclid.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.