Skip to content
TraceLead

Capture the GCLID in your form, even when the lead comes days after the click

Add a hidden field named tl_gclid and TraceLead fills it with the Google Ads click id from the visitor's first visit, on whichever page they enquire from, for 90 days by default. The click id reaches your CRM with the lead, ready for your offline conversion import.

No card needed. No lead caps on any plan.

Added to your CRM with the lead Sample data

Added by TraceLead's hidden fields. The name and email stay in your form.

Channel
Paid search
Source / medium
google / cpc
Campaign
brand-uk
Click ID
gclid
Arrived from

Why the gclid hidden field arrives empty

Google adds ?gclid= to the address of the page the ad opens, and only that page. A script that copies it from the address bar into the form works when the visitor enquires there and then.

Ad visitors rarely do. They read the pricing page, leave, and come back by typing your address before they send the form. The click id is gone, and the sale you later win cannot be matched to the ad that started it. Some iOS clicks carry gbraid or wbraid instead, which a gclid-only script misses altogether.

Two visits, one enquiry Sample data
  1. Monday Clicks a Google ad, lands on /pricing?utm_source=google&utm_medium=cpc&utm_campaign=brand-uk&gclid=…, leaves.
  2. Thursday Types your address, opens /contact, sends the contact form.
Hidden field Read from the URL Filled by TraceLead
tl_channel empty paid_search
tl_source empty google
tl_utm_campaign empty brand-uk
tl_gclid empty Cj0KCQjw…
tl_landing_page /contact /pricing?utm_source=google&utm_medium=cpc

TraceLead keeps the click id in a first-party cookie on your own domain once your banner allows it, and fills the field on whichever page the form is sent from, for as long as the site's first-touch lifetime.

How to capture the gclid in a form

Four steps. The form looks and submits exactly as before; it just carries three more values.

The full install guide
  1. Add the TraceLead tag to every page

    Paste the script tag with your site ID before </body>, or add it through Google Tag Manager or the WordPress plugin. It has to be on the landing pages your ads point to, as well as the page with the form.

    <script async src="https://app.tracelead.io/snippet/v1/tracelead.js"
            data-site="tl_YOUR_SITE_ID"></script>
  2. Add the click id fields to the form

    One hidden input per Google click id, plus the time of the first visit, which tells you when the click happened:

    <input type="hidden" name="tl_gclid">
    <input type="hidden" name="tl_gbraid">
    <input type="hidden" name="tl_wbraid">
    <input type="hidden" name="tl_first_touch_at">

    Forms that appear later, in a pop-up or a single-page app, are filled when they appear.

  3. Give the gclid a field in your CRM

    Create a text field for each click id on the lead or contact record and map the hidden fields to it. The CRM fields guide covers HubSpot, Salesforce, Pipedrive, Zoho and Dynamics.

  4. Connect your cookie banner, then test

    Nothing is stored or filled until the visitor agrees. Pick your consent manager in the site's attribution settings, or call tracelead('consent', true) from your banner. Then open a landing page with ?gclid=test-123, accept cookies, click through to another page, send the form and check that tl_gclid holds test-123.

From the gclid in your CRM to offline conversions

TraceLead's part ends at the form: the click id arrives with the lead. Uploading it to Google Ads when the lead becomes a sale is done by you or your CRM, with the gclid and the conversion time from your records.

These fields hold the first visit. If the first visit TraceLead recorded was not an ad, tl_gclid stays empty: switch on last touch and add tl_last_gclid to catch an ad click that came later.

TraceLead's own dashboard records only that a Google click id was present, never its value.

Hidden field Holds
tl_gclid Google Ads click id, for offline conversion import
tl_gbraid Google Ads click id used on iOS in place of the gclid
tl_wbraid Google Ads click id used on iOS in place of the gclid
tl_channel The channel the first visit came from
tl_utm_campaign The campaign name from your UTM tags
tl_utm_term The keyword, when your ads tag it
tl_first_touch_at When the first visit happened
tl_last_gclid The most recent Google Ads click id (when last touch is on)

Attribution without personal data. No names, emails, form values, IP addresses or user agents. Ever.

No privacy workarounds. Nothing before consent, no fingerprinting, no ad-blocker bypass, no cross-site identity.

Made in the UK. GBP pricing, UK consent rules in mind, and a person who answers email.

Questions, answered

Anything else? Email us and a person replies.

How do I add a gclid hidden field to my form?

Add <input type="hidden" name="tl_gclid"> inside the form, with tl_gbraid and tl_wbraid beside it. TraceLead fills only fields that are already in the form and never adds fields of its own. In a form builder, use the builder's own hidden field and name it tl_gclid; the docs give the syntax for each builder.

How do I track Google Ads leads in my CRM?

Create a text field in the CRM for each value you want (the click id, the channel, the campaign) and map the form's hidden fields to them. Each lead then carries its gclid and campaign on the record. The CRM fields guide has the steps for HubSpot, Salesforce, Pipedrive, Zoho and Dynamics.

Can I use the gclid for offline conversion imports?

That is what it is for. The gclid reaches your CRM with the lead; when the lead becomes a sale, you or your CRM upload the click id and the conversion to Google Ads. TraceLead does not connect to your Google Ads account and uploads nothing to Google: it only puts the click id into the form.

What are gbraid and wbraid?

Google Ads click ids that some iOS traffic carries in place of the gclid. TraceLead keeps them exactly like the gclid and classifies all three as google / cpc / paid_search. Add tl_gbraid and tl_wbraid next to tl_gclid so no Google click arrives empty.

How long is the gclid kept?

For the first-touch lifetime you set for the site, 90 days by default and anything from 1 to 400 days. It lives in a first-party cookie on your own domain, with local storage as a fallback.

What if the visitor clicks a second ad before enquiring?

tl_gclid keeps the first click. Switch on last touch for the site and add tl_last_gclid to also receive the most recent ad click. A direct visit, such as a bookmark or a typed address, never replaces either.

Is the gclid kept if the visitor has not accepted cookies?

Nothing is stored or filled until your consent banner says yes. The landing address is read in memory when the page loads, so a visitor who accepts on the landing page still has the click id kept. A visitor who never accepts sends the form with the fields empty, and the form submits as normal.

Your next Google Ads lead, with its click id.

One script tag and three hidden fields. The gclid is in your CRM from the next enquiry on.

No card needed. Cancel any time.

The whole install v1.4.0
<script async src="https://app.tracelead.io/snippet/v1/tracelead.js"
        data-site="tl_YOUR_SITE_ID"></script>

<form id="enquiry">
  …your fields…
  <input type="hidden" name="tl_gclid">
  <input type="hidden" name="tl_gbraid">
  <input type="hidden" name="tl_wbraid">
  <input type="hidden" name="tl_utm_campaign">
</form>