Skip to content

Capture the Click ID: How to Pass gclid, fbclid and UTMs Through Any Form So Your Ads Can Learn

Anam Jalal

Founder & CEO, MAJ Leads

Updated 4 Nov 2026 · 8 min read

Quick answer

UTM parameters are labels you add to a link, such as utm_source and utm_campaign. Click IDs are different: Google auto-tagging adds gclid and Meta adds fbclid. To let your ads learn from your leads, read all of them from the landing page URL, put them in hidden form fields and save them with the lead.

Note

Sources and status. We read Google's and Meta's pages on 4 November 2026. Rule marks something one of those pages states. Practice marks our advice. We tested the script below in Node against a stubbed browser, not on a live ad or in a live browser, so test it on your own form before you rely on it. Sending outcomes back to Google and Meta is rolling out in MAJ Leads, and we have no customer campaign results to report.

What are UTM parameters?

Rule. Google Analytics' help page lists the campaign parameters you can add to a link: utm_id, utm_source, utm_medium, utm_campaign, utm_source_platform, utm_term and utm_content. It says that when you add parameters you should always use utm_source, utm_medium and utm_campaign, and that missing ones show up as "(not set)" in reports. Values are case sensitive, so the page's own example is that SpringSale and Spring_Sale count as two campaigns. It recommends lowercase and a fixed naming scheme.

Practice. UTMs are labels you write, so they work for any link: an ad, an email, a QR code, a post. Pick the naming once, in lowercase, and write it down. They tell your analytics and your CRM which campaign a lead came from. They do not, on their own, tell Google or Meta which click it was.

What are gclid and fbclid?

The identifiers worth saving with every lead
IdentifierWho adds itWhat to storeRule from the platform's pages
gclidGoogle Ads auto-taggingThe value, unchangedAuto-tagging attaches the Google Click Identifier to the URL the customer clicks. You save it with the lead and give it back to Google Ads when the lead converts
gbraid, wbraidGoogle Ads, for some iOS clicksThe value, unchangedgbraid is for web clicks that lead to an iOS app, wbraid for in-app iOS clicks that lead to a web page. When several are present Google uses gclid, then wbraid, then gbraid, and says to send every identifier you captured
fbclidMeta, on ad clicksThe value, unchanged, case preservedCase sensitive. Meta says not to modify it before use. It becomes the fbc value, in the form fb.1.creation time in milliseconds.fbclid
utm_*YouAll of them you usedAlways use source, medium and campaign. Keep names consistent

Rule. Google's auto-tagging page says auto-tagging attaches the GCLID to the URL a customer clicks. The offline conversion import page says you save it with the lead's details and later give it back to Google Ads with the conversion type and timing. The Upload clicks page says a GCLID is captured from URL parameters when someone clicks your ad, recommends including it even if you use the Google tag, and says that when you send a wbraid or gbraid without a gclid, Google Ads ignores the hashed contact details you send with it.

Rule. Meta's fbp and fbc page says to read the fbclid value from the URL's query string without changing its case, and to build the fbc value as fb., a subdomain index (1 if you build it on a server and save no cookie), the time in milliseconds when you saved or first saw it, then the fbclid. If the Meta Pixel is installed, it stores the formatted value in an _fbc cookie, so read that first. Meta says to set the cookie to last 90 days if you set it yourself, and to send fbc with every Conversions API event. The parameters page says not to hash fbc.

How do you pass click IDs and UTMs through a form?

  1. Turn on auto-tagging in Google Ads. Without it there is no gclid to capture. Meta ad clicks carry an fbclid in the URL, which its fbc page builds on, and you add the UTMs to your ad URLs.
  2. Check the landing page URL. Click one of your own ads in a test, or open the final URL, and look at the address bar. If the parameters are missing on arrival, something between the ad and the page, such as a redirect, dropped them. Fix that first. This is practice, not a rule from the platforms.
  3. Add hidden fields to the form. One field for each: gclid, gbraid, wbraid, fbclid and the UTMs you use. The field names must match what the script looks for.
  4. Read the URL when the page loads and keep the values. The visitor often browses a few pages before filling in the form, so a script has to store the values on the first page and fill the form on a later one. The script below does both.
  5. Save the fields with the lead. Put them in dedicated columns in your CRM, not in a notes field. A later upload needs them as data.
  6. Record consent with the lead. Google's Upload clicks page highly recommends filling the consent field, and says that without it conversions may not be attributable.
(function () {
  var KEYS = ["gclid", "gbraid", "wbraid", "fbclid", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"];
  var STORE = "ad_click_params";
  var saved = {};
  try {
    saved = JSON.parse(localStorage.getItem(STORE) || "{}");
  } catch (e) {}
  var params = new URLSearchParams(window.location.search);
  var fresh = {};
  KEYS.forEach(function (key) {
    var value = params.get(key);
    if (value) fresh[key] = value;
  });
  if (Object.keys(fresh).length) {
    saved = fresh;
    try {
      localStorage.setItem(STORE, JSON.stringify(saved));
    } catch (e) {}
  }
  KEYS.forEach(function (key) {
    var input = document.querySelector('input[name="' + key + '"]');
    if (input && saved[key]) input.value = saved[key];
  });
})();
A sketch for a plain HTML form. Put it on every landing page. Replace the field names if your form tool calls them something else

The script reads the nine parameters from the address, and if any is present it replaces what it stored before. That keeps the last click's identifiers together, so a gclid from last week does not sit beside an fbclid from today. It fills any hidden input whose name matches. Storage is in the browser's local storage, wrapped so the page still works when a browser blocks it. Storing identifiers in a browser can need consent under your cookie policy, so ask whoever advises you on that.

What breaks when you capture click IDs?

  • The form lives on another domain. A booking tool or an embedded form on a different address cannot read your page's URL. Use that tool's hidden-field setting and pass the values in, or place the form on your own domain.
  • The value is changed. Lowercasing an fbclid breaks the match, because Meta says it is case sensitive and should not be modified.
  • The identifiers are separated from the lead. If the form submits to one tool and your CRM gets the lead from another, check that the fields travel with it.
  • Inconsistent UTM names. Two spellings of one campaign are two campaigns, as Google's page says.
  • A blocked browser store. Some browsers and privacy settings refuse storage, so expect some leads to arrive without identifiers and measure how many.

What about leads who call or message instead of filling in a form?

Many UAE enquiries end as a phone call or a WhatsApp chat. The Google pages we read do not say how a click ID reaches the lead in that case, so we do not claim that hashed phone numbers will match. Practice: read and store the identifiers on the landing page before the person taps call or WhatsApp, and pass them into the lead when it arrives. For Click to WhatsApp ads, Meta's webhook carries its own click ID, as we explain in Click-to-WhatsApp leads.

What does MAJ Leads do with click IDs?

A lead's attribution record in MAJ Leads is built to hold the source, campaign, ad, the gclid or fbclid where present, any UTM parameters, the landing URL and the time of the first touch, and the website form capture is built to take those from a paid visit that converts on-site. That record is what a later report back to the ad platform uses. The reports are described in Google Ads offline conversion import, Meta Conversions API for CRM and closed-loop attribution. See how it works and pricing.

Sources

Frequently asked questions

What are UTM parameters?
They are labels added to a link, such as utm_source, utm_medium and utm_campaign, that tell your analytics which campaign sent a visitor. Google Analytics' page says to always use utm_source, utm_medium and utm_campaign, that missing ones show as (not set), and that values are case sensitive.
What is a gclid?
It is the Google Click Identifier that Google Ads auto-tagging attaches to the URL of an ad click. You save it with the lead and give it back to Google Ads when the lead converts, so the conversion can be tied to the click. Google also uses gbraid and wbraid for some iOS clicks.
How do I capture gclid in a form?
Turn on auto-tagging, add a hidden field named gclid to the form, read the gclid from the landing page URL with a script when the page loads, store it for later pages, and fill the field before the form is submitted. Then save the field with the lead in your CRM as its own column.
What is the fbc value and how is it built from fbclid?
Meta's page gives the format fb.subdomainIndex.creationTime.fbclid, where creationTime is in milliseconds. The fbclid must be used exactly as received because it is case sensitive. If the Meta Pixel is installed it keeps this value in an _fbc cookie, which Meta says to read first. Do not hash fbc.
Can I capture click IDs for leads who phone or use WhatsApp?
Only if you read and store them on the landing page before the person leaves it. The Google pages we read do not say how a click ID reaches a lead that starts as a call or a WhatsApp chat. Meta's webhook for Click to WhatsApp ads carries a separate click ID, ctwa_clid, on the first message.

Anam Jalal

Founder & CEO, MAJ Leads

Anam Jalal is the founder of MAJ Leads, a Dubai-based lead management system that puts every paid lead on a rep's phone within about thirty seconds and chases it until it has an answer. He works hands-on with UAE clinics, brokerages and trading companies on lead follow-up, WhatsApp and CRM integrations, and ran voice AI deployments in the UAE before the company focused on lead management.

Read more about Anam

Related articles

Explore our services