Sub topic 5
Auto-tagging and the `gclid` parameter
Prerequisites and working model
This chapter assumes that you know how GA4 properties and data streams work, understand events and event parameters, and have linked your GA4 property to Google Ads.
Auto-tagging is a Google Ads setting that adds a click identifier to an ad's landing-page URL. The identifier is called gclid, which means Google Click Identifier. For example:
https://www.example.com/pricing?gclid=EAIaIQobChMIexampleThe gclid value identifies the ad click. GA4 can use it to connect the landing-page session with Google Ads campaign, ad group, keyword, and click data. Google Ads can also use the click information when it measures conversions imported from GA4.
The basic data flow is:
Google Ads click
|
v
Landing URL + gclid
|
v
GA4 captures the session and click information
|
v
Google Ads campaign details and conversion attributionEnable auto-tagging
In Google Ads, open Admin and find the auto-tagging setting in the account settings. Turn on Tag the URL that people click through from my ad. The exact menu labels can change, but the setting belongs to Google Ads rather than GA4.
Also check these conditions:
- The Google Ads account is linked to the correct GA4 property.
- The ad's final URL points to the intended landing page.
- Your site preserves query parameters during redirects.
- Your GA4 web data stream uses the Google tag or another supported tagging setup.
- Consent settings do not prevent analytics storage when a user has not granted the required consent.
Auto-tagging does not replace the GA4 tag. It supplies click information, while the GA4 tag collects the session and events.
Inspect the parameter
You can test whether a landing URL contains a gclid with this small Python program:
from urllib.parse import parse_qs, urlparse
url = "https://www.example.com/pricing?gclid=EAIaIQobChMIexample"
query = parse_qs(urlparse(url).query)
gclid = query.get("gclid", [None])[0]
if gclid:
print(f"gclid found: {gclid}")
else:
print("No gclid found")A browser test is useful, but it does not prove that GA4 stored the click. After opening the URL, use GA4 DebugView or real-time reports and check the resulting traffic source. Do not expect the raw gclid value to appear as a normal report dimension in every GA4 report.
Common errors
A redirect can remove the query string. For example, a redirect from /offer to /pricing may preserve the path but discard ?gclid=.... Configure the redirect to retain the complete query string.
Manual UTM parameters can also create confusing results. If a URL contains both auto-tagging and manual campaign parameters, Google systems may apply precedence rules that produce values different from what you expected. Use manual UTMs for channels that do not support auto-tagging, and test mixed URLs deliberately.
A missing gclid can also result from disabled auto-tagging, an incorrect final URL, consent restrictions, browser privacy controls, or a landing page that loads without the Google tag.
Exercise
A Google Ad opens the correct page, but the gclid disappears after the page redirects. What should you check first?
Show answer
Check whether the redirect preserves the complete query string, including the gclid parameter. Then verify auto-tagging, the GA4 tag, consent behavior, and the Google Ads link.