Skip to content
FunnelGuard

Fix guide by FunnelsGuard

gclid/fbclid not saved in your CRM: fix offline conversions

DLV-096High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

When someone clicks a Google ad, Google adds a gclid (Google click ID) to the landing page URL. Meta adds fbclid in the same way. These IDs are what let the ad platform match a later sale in your CRM to the original click. This is called an offline conversion import.

The issue is that the ID is in the URL when the visitor arrives, but is not on the contact or deal record when the lead is created. Common reasons: no hidden field on the form, the ID is lost when the visitor moves to another page, a redirect strips it, or the CRM has no field to receive it.

Why it costs you leads or sales

Without the click ID, you can't tell Google Ads or Meta which clicks turned into paying customers. Smart bidding then optimises for form fills, not revenue, and keeps paying for clicks that never close. Reports show leads but not which campaign produced the sales.

Where the click ID gets lost
  1. Ad clickURL has ?gclid=...
  2. Landing pageID is in the URL
  3. Form submitNo hidden field, ID not sent
  4. CRM recordgclid field empty
  5. Offline importNo match for the sale

The ID is present on landing but never reaches the CRM, so the closed deal can't be sent back to the ad platform.

Closed deals that can be matched to an ad clickExample numbers
Closed deals that can be matched to an ad click (example)Closed deals: 40 deals; With gclid stored (broken): 3 deals; With gclid stored (fixed): 36 deals0153140336Closed dealsWith gclid stored (br…With gclid stored (fi…deals

Example: of 40 deals closed from paid leads in a month, only those with a stored click ID can be imported back.

How to check if your site has it

Manual check in about 10 minutes
  1. Visit your landing page with a test ID

    Open the page in a private window with ?gclid=TEST123 added to the URL, for example https://example.com/landing?gclid=TEST123.

  2. Navigate and submit

    Click through to your form page like a normal visitor, then submit the form with a test name and email.

  3. Open the CRM record

    Find the new contact or lead and look for a gclid property. It should read TEST123.

  4. Check webhooks too

    If the form sends data to the CRM through a webhook or Zapier-style tool, view the request payload and look for the gclid key.

  5. Repeat for fbclid

    Do the same with ?fbclid=TEST456 if you run Meta ads.

How to fix it

The fix has three parts: save the ID when the visitor lands, send it with the form, and give the CRM a field to hold it. Start with the script, which works on any site.

Save gclid and fbclid for 90 days, then fill hidden fieldsjavascript
(function () {
  var params = new URLSearchParams(window.location.search);
  ['gclid', 'fbclid'].forEach(function (key) {
    var value = params.get(key);
    if (value) {
      document.cookie = key + '=' + encodeURIComponent(value) + '; max-age=7776000; path=/; SameSite=Lax';
    }
  });
  function getCookie(name) {
    var match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
    return match ? decodeURIComponent(match[1]) : '';
  }
  document.addEventListener('DOMContentLoaded', function () {
    ['gclid', 'fbclid'].forEach(function (key) {
      document.querySelectorAll('input[name="' + key + '"]').forEach(function (el) {
        el.value = getCookie(key);
      });
    });
  });
})();
Hidden fields inside your formhtml
<input type="hidden" name="gclid" value="">
<input type="hidden" name="fbclid" value="">
Platform-specific steps
  1. Add hidden fields

    In your form plugin (the exact name depends on the plugin), add hidden fields named gclid and fbclid. Some plugins let you fill them from a URL parameter or cookie; otherwise use the script above.

  2. Load the script on every page

    Add the script through a header and footer code plugin or your child theme so it runs on the landing page, not only the form page.

  3. Map to the CRM

    In the form's CRM integration or webhook settings, map the hidden fields to your CRM properties.

Finish in the CRM
  1. Create the properties

    Add single-line text fields called gclid and fbclid on the contact, lead or deal object. In HubSpot these are contact properties; in Salesforce they are custom fields on Lead and Contact. Use the same field name on the lead and the converted contact so the value carries over.

  2. Map the form fields

    Match each hidden field to its CRM property in your integration, native connector or webhook.

  3. Check redirects

    Make sure redirects and link tools keep the query string, otherwise the ID is gone before the script runs.

  4. Use the ID in your import

    Export the stored gclid with the conversion time and value to Google Ads offline conversion import, or send fbclid-based data to Meta, following each platform's current requirements.

How to confirm it's fixed

Fix verification
  • A submission made after visiting ?gclid=TEST123 shows TEST123 on the CRM record
  • The value is still there when you browse to another page before submitting
  • The value is exact, with the same case and length
  • fbclid is stored the same way
  • Webhook payloads contain the gclid key
  • A visit without a click ID leaves the field blank and the form still submits

How to prevent it happening again

This usually breaks quietly after a form rebuild, a theme change, a new redirect or a CRM field rename. Re-test after any of those changes.

Habits that keep it working
  • Include the click ID test in your release checklist for forms and landing pages
  • Don't rename or delete the CRM properties without updating the mapping
  • Review redirects and link shorteners for query string loss
  • Keep the capture script on all landing pages
  • Run a scheduled check that submits a tagged test lead

How FunnelGuard handles this

FunnelGuard detects this today. A robot visitor runs your lead form journey on a schedule, from the EU or the US, with a test click ID on the landing URL. It then checks whether the gclid shows up on the CRM contact, and for webhooks it checks that the request payload contains the click ID.

If the check fails, it is re-checked from a second region before one alert goes out by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. Test traffic is marked (utm_source=funnelguard, fg_test=1, an fg_test cookie and its own user agent) and never clicks real ads. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans have a 3-day free trial.

Questions people ask

Why is my gclid not showing in my CRM?

Usually the form has no hidden field for it, or the ID is lost before the form is submitted. Redirects that drop the query string and a missing CRM property or mapping are other common causes. Test with ?gclid=TEST123 and trace where it disappears.

How do I store the gclid in my CRM?

Save the gclid from the landing URL into a first-party cookie, add a hidden field named gclid to your form and fill it from the cookie. Then create a text property in your CRM and map the form field to it.

Do I need the gclid for Google Ads offline conversion imports?

Yes, for click-based imports Google Ads needs the gclid to match a conversion to a click. Without it you would need another supported matching method, such as enhanced conversions for leads, which uses hashed customer data.

How long should I keep the gclid cookie?

A common choice is 90 days, as in the script above, but the right length depends on your sales cycle and Google's import time limits. Check the current Google Ads rules and your own consent and privacy policy.

Why does the gclid disappear when visitors move to another page?

The ID only exists in the URL of the first page. If you don't save it to a cookie or storage, the next page load loses it. Redirects that remove query strings cause the same problem.

Is fbclid handled the same way as gclid?

The capture method is the same: read it from the URL, store it, send it in a hidden field and save it in a CRM property. How you send it to Meta afterwards follows Meta's own requirements, which can change.

Can I test this without real ad clicks?

Yes. Add a made-up ?gclid=TEST123 to your landing page URL and submit a test form. Check the CRM record, then delete it. Don't upload fake IDs to an ad platform.

Can FunnelGuard tell me if the gclid is missing from my CRM?

Yes. FunnelGuard submits your lead journey with a test click ID, then checks the CRM contact for a gclid and, for webhooks, whether the payload contains it. You get an alert if it is missing.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: crm_contact gclid; payload_contains for webhooks.

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.