GCLID Tracking in WordPress: Capture Google Ads Click IDs in Your Forms

Every Google Ads click that lands on your website carries a unique identifier called a GCLID — the Google Click ID. It’s the key that connects an ad click to a conversion. Without it, you can’t tell Google Ads which clicks actually generated leads, which means your campaigns optimise on incomplete data and your reported cost-per-lead is wrong.

The problem: most WordPress forms don’t capture the GCLID. It sits in the URL of the landing page, and by the time the visitor submits a form — often several pages later — the GCLID is gone.

This guide covers what the GCLID actually is, why it matters for lead generation, how to capture and store it in WordPress, and how to pass it through your forms to your CRM for offline conversion tracking.

What Is the GCLID?

GCLID stands for Google Click Identifier. It’s a unique parameter that Google Ads automatically appends to your destination URL when someone clicks one of your ads. You don’t need to add it manually — it’s generated by Google’s auto-tagging feature, which is enabled by default in every Google Ads account.

When someone clicks your ad, the landing page URL looks something like this:

https://yoursite.com/landing-page/?gclid=CjwKCAjw7Y2zBhA-EiwA5akQ...

That long string after gclid= is a unique, encrypted identifier tied to that specific click. It encodes the campaign, ad group, keyword, match type, device, and timestamp — but the data is encrypted and can only be interpreted by Google’s own systems. You can’t manually decode a GCLID to extract campaign details.

What you can do is store the GCLID value and send it back to Google later, which is exactly how offline conversion tracking works.

Why Capturing the GCLID Matters for Lead Generation

If you’re running Google Ads for lead generation — contact forms, quote requests, demo signups — the GCLID is your most valuable attribution signal. Here’s why:

1. Offline Conversion Tracking

A form submission isn’t a sale. When your sales team closes the deal days or weeks later, you need a way to tell Google Ads that the original click converted into revenue. The GCLID is the link. You capture it at form submission, store it in your CRM alongside the lead’s contact details, and later upload it back to Google Ads as an offline conversion. Google then attributes that revenue to the exact keyword, ad group, and campaign that drove the click.

Without the GCLID, your Google Ads reporting stops at “form submitted.” You can’t see which keywords generate leads that actually close.

2. Smart Bidding Optimisation

Google’s automated bidding strategies (Target CPA, Target ROAS, Maximise Conversions) use conversion data to decide how much to bid on each auction. When you feed offline conversion data back via GCLIDs, Smart Bidding learns which types of clicks generate actual revenue — not just form fills. This means your bids are optimised for business outcomes, not vanity metrics.

3. Closing the Loop Between Ads and Revenue

The GCLID connects your CRM data to your ad data. Once a lead converts to a customer, you can trace the entire path: which Google search query triggered the click, which ad they saw, which landing page they arrived on, and what the lead was worth. That’s the data you need to allocate budget to the campaigns that actually drive revenue.

GCLID vs. UTM Parameters

People often confuse GCLIDs with UTM parameters. They’re related but serve different purposes:

GCLIDUTM Parameters
Added byAutomatically by Google Ads (auto-tagging)Manually by you on any URL
Works withGoogle Ads onlyAny traffic source (Google, Meta, email, etc.)
Human-readableNo — encrypted stringYes — utm_source=google, utm_medium=cpc
Used forGoogle Ads conversion tracking, offline imports, Smart BiddingCampaign reporting in any analytics tool
Can coexistYes — you should use both. UTMs give you readable reporting; GCLIDs give you Google Ads integration.

Best practice: tag your Google Ads URLs with UTM parameters and keep auto-tagging enabled. The UTMs give you human-readable attribution in your analytics and CRM. The GCLID gives you the connection to Google Ads for bidding optimisation and offline conversions.

The Core Problem: GCLIDs Disappear on Page Navigation

The GCLID is a URL query parameter. It exists only in the URL of the page the visitor lands on. The moment they click to another page on your site, the GCLID is gone from the URL.

This is exactly how UTM parameters work — and it creates the same problem. If your contact form is on a different page from your landing page (which is the case for most websites), a hidden field that reads the URL won’t find a GCLID to capture.

Additional factors that can strip the GCLID before it even reaches your page:

  • Server-side caching — Managed hosting platforms like WP Engine have historically stripped query parameters including GCLIDs in certain cache configurations.
  • Redirect chains — If your URL redirects (HTTP to HTTPS, non-www to www, missing trailing slash), the GCLID can be dropped if the redirect doesn’t pass query strings through.
  • CDN edge caching — Cloudflare APO and similar services may serve cached pages that don’t reflect the GCLID in the original request.
  • Safari ITP — Apple’s Intelligent Tracking Prevention can limit the lifetime of cookies set via JavaScript, which affects GCLID persistence.

The solution is the same as for UTM parameters: capture the GCLID on arrival and store it in a browser cookie so it’s available on every subsequent page.

How to Capture the GCLID in WordPress Forms

There are three approaches, each with different trade-offs in complexity and reliability.

Method 1: Hidden Fields (Basic — Landing Page Only)

Every major WordPress form plugin supports hidden fields that can read URL query parameters. You add a hidden field, set it to read the gclid parameter from the URL, and it captures the value when the form is submitted.

Contact Form 7:

[hidden gclid default:get]

Gravity Forms: Add a Hidden field, enable “Allow field to be populated dynamically,” set Parameter Name to gclid.

WPForms: Add a Hidden Field, set Default Value to {query_var key="gclid"}.

Elementor Pro: Add a Hidden field, set Default Value to the “Request Parameter” dynamic tag with Param Name gclid.

Limitation: This only works when the form is on the same page the visitor landed on. If they navigate to another page before submitting — which most visitors do — the GCLID won’t be in the URL and the hidden field will be empty.

Method 2: JavaScript Cookie + Hidden Fields (Reliable)

The standard approach is to use JavaScript to capture the GCLID on arrival and store it in a first-party cookie. Then, on any page where a form exists, another script reads the cookie and injects the value into a hidden form field.

The logic follows this pattern:

  1. On page load: Check the URL for a gclid parameter. If found, write its value to a first-party cookie (e.g., _gclid) with your chosen expiration (session, 7 days, 30 days, 90 days).
  2. On any page with a form: Read the _gclid cookie. If it exists, find the hidden form field and set its value to the cookie contents.
  3. On form submission: The hidden field value is submitted along with the rest of the form data. The GCLID is now stored alongside the lead’s name and email in your form entries or CRM.

You can implement this with Google Tag Manager (using the community “Persist Campaign Data” template to store the cookie and a Custom HTML tag to populate hidden fields) or with a standalone JavaScript snippet enqueued via your child theme’s functions.php.

Pros: Works across pages, reliable, customisable cookie duration.
Cons: You still need to add hidden fields to every form. Different form plugins require different hidden field configurations. Each new form needs manual setup. And you need to maintain the JavaScript through WordPress and theme updates.

Method 3: Automatic Capture with a Plugin (Simplest)

Several WordPress plugins handle the entire GCLID capture workflow — from reading the URL parameter to storing it in a cookie to attaching it to form submissions. The key difference between them is whether you still need to add hidden fields to your forms.

Plugins that still require hidden fields: HandL UTM Grabber, Attributer, and Campaign Tracker all store the GCLID in a cookie for you, but you still need to add hidden fields to each form and configure them to read from the cookie or shortcode. They automate the persistence but not the form integration.

Plugins that don’t require hidden fields: LeadSourcePro takes a different approach. It hooks directly into your form plugin at the server level and attaches the GCLID (along with UTM parameters and other click IDs) to each submission automatically. No hidden fields, no shortcodes, no per-form configuration.

Here’s how LeadSourcePro handles GCLID capture:

  1. A lightweight vanilla JavaScript file runs on every page. When a visitor arrives with a gclid in the URL, the script captures it and stores it in a first-party cookie.
  2. The cookie persists as the visitor browses your site (configurable window: same session, 1 day, or 7 days).
  3. When they submit any form — Contact Form 7, WPForms, Gravity Forms, Fluent Forms, Elementor Pro, Ninja Forms, Formidable, Forminator, or Jetpack — LeadSourcePro reads the cookie and attaches the GCLID to the submission automatically.
  4. The GCLID appears in your WordPress dashboard alongside the form data. You can export it via CSV for offline conversion imports to Google Ads.

LeadSourcePro also captures fbclid (Meta), msclkid (Microsoft), li_fat_id (LinkedIn), and ttclid (TikTok) — so you get full click ID coverage across all major ad platforms, not just Google.

How to Use Captured GCLIDs for Offline Conversion Tracking

Once you’re capturing the GCLID with every form submission, you can feed that data back to Google Ads to track which clicks turned into actual customers. Here’s the process:

Step 1: Create an Offline Conversion Action in Google Ads

In your Google Ads account, go to Goals → Conversions → New conversion action. Select “Import” as the source, then choose “Other data sources or CRMs” and select “Track conversions from clicks.” Give it a name (e.g., “Qualified Lead” or “Closed Sale”) and configure the conversion window and value.

Step 2: Store GCLIDs in Your CRM

When a form submission comes in with a GCLID, ensure it’s passed to your CRM alongside the lead’s contact details. If you use Zapier, Make, or a direct CRM integration from your form plugin, map the GCLID field to a custom property in your CRM (e.g., a custom field called “Google Click ID” in HubSpot, Salesforce, or Pipedrive).

Step 3: Upload Conversions When Leads Close

When a lead becomes a customer, export the GCLID, conversion date/time, and conversion value. Upload this data to Google Ads via:

  • Manual CSV upload — Go to Goals → Conversions → Uploads in Google Ads. Upload a CSV with columns for Google Click ID, Conversion Name, Conversion Time, and optionally Conversion Value.
  • Google Ads API — For automated imports, use the ConversionUploadService to push GCLID conversions programmatically.
  • Google Ads Data Manager — Google’s recommended method for 2025+, supporting imports from Google Sheets, cloud storage, Salesforce, and HubSpot.
  • CRM integrations — Salesforce, HubSpot, and other CRMs have direct Google Ads integrations that can automate offline conversion uploads.

Imported conversions typically appear in your Google Ads account within 3 hours. They’ll be attributed to the campaign, ad group, and keyword that drove the original click.

A Note on Enhanced Conversions for Leads

Google now recommends Enhanced Conversions for Leads as an upgrade to traditional GCLID-based offline imports. Enhanced Conversions uses hashed first-party data (like email addresses) as an additional match key, improving match rates and enabling cross-device attribution. You should still capture and pass GCLIDs where possible — Google recommends including them even when using Enhanced Conversions — but the hashed email provides a fallback when GCLIDs are lost or unavailable.

Troubleshooting: GCLID Not Being Captured

If your forms are coming through with blank GCLID fields, work through this checklist:

  1. Verify auto-tagging is enabled. In Google Ads, go to Settings → Account Settings and confirm “Tag the URL that people click through from my ad” is turned on.
  2. Click your own ad and check the URL. You should see ?gclid= appended to your landing page URL. If it’s missing, auto-tagging isn’t working or a redirect is stripping it.
  3. Check for redirect chains. Paste your landing page URL (with GCLID) into a redirect checker. If you see 301/302 hops where the query string drops off, fix your server redirect rules to pass query parameters through.
  4. Test your caching. Temporarily disable your caching plugin and test again. If the GCLID appears, add a cache exclusion rule for URLs containing gclid.
  5. Confirm the form is on the landing page. If you’re using Method 1 (hidden fields only), the form must be on the same page the visitor lands on. If it’s not, you need cookie-based persistence (Method 2 or 3).
  6. Check the hidden field configuration. Ensure the parameter name matches exactly: gclid (lowercase, no spaces).
  7. Test with a real ad click. The GCLID is only generated by actual ad clicks. Manually adding ?gclid=test123 to a URL works for testing your form capture, but the value won’t be valid for Google Ads imports.

Frequently Asked Questions

Can I decode a GCLID to see which campaign or keyword it came from?

No. The GCLID is an encrypted identifier that only Google’s systems can interpret. You can’t manually extract campaign, ad group, or keyword data from the GCLID string itself. To see what data a GCLID contains, you’d need to use the Google Ads API’s click_view resource or upload the GCLID as an offline conversion, at which point Google attributes it to the correct campaign elements in your reporting.

How long does the GCLID remain valid for offline conversion imports?

GCLIDs are valid for up to 90 days when using Google Ads Data Manager, Google Cloud Storage, or other supported data sources. For direct uploads via the Google Ads interface, the conversion must occur within the conversion window you’ve configured for that conversion action (typically 30, 60, or 90 days). Conversions uploaded after the window expires won’t be attributed.

Do I need both GCLID and UTM parameters on my Google Ads URLs?

Yes — they serve different purposes. The GCLID is for Google Ads conversion tracking and Smart Bidding optimisation. UTM parameters are for campaign reporting in Google Analytics, your CRM, and other non-Google tools. With auto-tagging enabled, the GCLID is added automatically. You add UTM parameters manually in your ad’s final URL suffix or tracking template.

What happens if the GCLID is lost for some visitors?

You’ll have incomplete offline conversion data. Google Ads Smart Bidding will still learn from the conversions you do import, but it’s working with a partial picture. This is why Google now recommends Enhanced Conversions for Leads as a complement — it uses hashed email addresses as a fallback match key when GCLIDs aren’t available, improving your overall conversion match rate.

Does Google Analytics still track the GCLID if my form doesn’t capture it?

Yes. Google Analytics captures the GCLID independently via its own cookie when the visitor first arrives. Your GA4 reports will show session-level campaign attribution regardless of whether your form captures the GCLID. The issue is on the CRM side: without the GCLID in your form submission data, you can’t connect a specific lead in your CRM to a specific Google Ads click for offline conversion imports.

Start Capturing Every GCLID

Every Google Ads click without a captured GCLID is a broken link in your attribution chain. You can’t optimise what you can’t measure, and you can’t measure what you don’t capture.

The simplest path: install LeadSourcePro, which captures GCLIDs (plus fbclid, msclkid, li_fat_id, ttclid, and all UTM parameters) automatically across every page and every form — no hidden fields, no JavaScript to maintain, no per-form configuration.

See how it works, or install the free version and start capturing your next Google Ads click.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *