How Google Ads Tracking Works
Google Ads conversion tracking measures what users do after clicking an ad. The system has three core components:
- Google Tag (gtag.js) -- A JavaScript snippet loaded on your site that records user actions.
- Conversion actions -- Defined events in Google Ads (purchase, lead, sign-up) that count as conversions.
- GCLID (Google Click Identifier) -- A unique parameter appended to your landing page URL via auto-tagging. It ties ad clicks to on-site conversions for attribution.
The data flow works like this: a user clicks your ad, lands on your site with a ?gclid=... parameter, and triggers a conversion event. The Google Tag fires the event and sends the GCLID back to Google Ads, which matches the conversion to the original click, campaign, ad group, and keyword.
Google previously used separate "global site tag" and "event snippet" scripts. These are now unified under the single Google Tag. If you see references to gtag.js and separate event snippets, they still work but the recommended approach is the unified tag with gtag('event', 'conversion', {...}) calls.
The Google Tag also supports consent mode, Enhanced Conversions with first-party data, and server-side tagging through Google Tag Manager. Each is covered in detail below.
Installing the Google Tag
Direct Installation (gtag.js)
Place this snippet in the <head> of every page on your site. Replace AW-CONVERSION_ID with your Google Ads account conversion ID.
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-CONVERSION_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-CONVERSION_ID');
</script>
The gtag('config', ...) call initializes the tag and sends a page view event. If you also use GA4, you can add a second config line for your GA4 measurement ID without loading the script twice:
<script>
gtag('config', 'AW-CONVERSION_ID');
gtag('config', 'G-GA4_MEASUREMENT_ID');
</script>
GTM-Based Installation
If you use Google Tag Manager, you do not add the gtag.js snippet directly. Instead:
- Create a Google Ads Conversion Tracking tag in GTM.
- Enter your Conversion ID and Conversion Label.
- Set the trigger (e.g., a custom event or page view).
- Publish the container.
GTM handles loading the Google Tag infrastructure through its own container script. This approach gives you version control, preview/debug mode, and the ability to manage all tags in one interface.
Key Difference
Direct gtag.js installation requires code changes to add or modify conversion events. GTM lets you manage events through the GTM UI without touching site code. For sites with frequent tracking changes or multiple stakeholders, GTM is the better choice. For simple setups with one or two conversions, direct installation is lighter.
Conversion Actions
A conversion action defines what you want to track. You create these in Google Ads under Goals > Conversions > Summary. Each action has a Conversion ID (shared across your account) and a unique Conversion Label.
Conversion Types
| Type | Use Case | Counting |
|---|---|---|
| Purchase | E-commerce transactions | Every (count each purchase) |
| Lead | Form submissions, quote requests | One (count once per click) |
| Sign-up | Account registrations | One |
| Page view | Thank-you or confirmation pages | One |
| Phone call | Calls from ads or website | Every or One |
| Custom | Any action you define | Configurable |
Counting matters. "Every" counts each instance (appropriate for purchases where one click can lead to multiple orders). "One" counts a single conversion per click (appropriate for leads where duplicate submissions are not meaningful).
Tracking a Purchase
gtag('event', 'conversion', {
'send_to': 'AW-CONVERSION_ID/CONVERSION_LABEL',
'value': 49.99,
'currency': 'USD',
'transaction_id': 'ORDER-12345'
});
Always include transaction_id to prevent duplicate conversion counting. Google Ads deduplicates conversions with matching transaction IDs within the same conversion action.
Tracking a Phone Call
For website phone number tracking, Google Ads replaces your phone number with a Google forwarding number to track calls:
gtag('config', 'AW-CONVERSION_ID/CONVERSION_LABEL', {
'phone_conversion_number': '1-800-555-0199'
});
This requires the phone number to appear in the page HTML. Google's script swaps it with a forwarding number and records calls as conversions.
Conversion Windows
The conversion window defines how long after a click Google Ads will attribute a conversion. Defaults:
- Click-through: 30 days (configurable: 1-90 days)
- View-through: 1 day (configurable: 1-30 days)
- Engaged-view (video): 3 days (configurable: 1-30 days)
Set shorter windows for impulse purchases and longer windows for high-consideration products like enterprise software or real estate.
Enhanced Conversions
Enhanced Conversions improve attribution accuracy by sending hashed first-party customer data (email, phone, address) alongside your conversion tag. Google matches this data against signed-in Google users to attribute conversions that would otherwise be lost due to cookie restrictions, cross-device behavior, or ad blockers.
How It Works
- A user submits a form or completes a purchase on your site.
- Your conversion tag sends hashed PII (email, phone, name, address) to Google.
- Google matches the hashed data against its user database.
- The conversion is attributed to the original ad click.
The gtag.js library automatically hashes all user data fields with SHA-256 before transmission. You send plaintext values in your code; Google never receives unhashed PII.
Implementation
Set user data before or alongside your conversion event:
gtag('set', 'user_data', {
'email': 'user@example.com',
'phone_number': '+15551234567',
'address': {
'first_name': 'John',
'last_name': 'Doe',
'street': '123 Main St',
'city': 'Anytown',
'region': 'CA',
'postal_code': '12345',
'country': 'US'
}
});
// Then fire the conversion
gtag('event', 'conversion', {
'send_to': 'AW-CONVERSION_ID/CONVERSION_LABEL',
'value': 49.99,
'currency': 'USD',
'transaction_id': 'ORDER-12345'
});
Data Requirements
- Email must be lowercase and trimmed of whitespace.
- Phone must include country code (e.g.,
+15551234567, not555-123-4567). - Address fields should be lowercase.
regionuses the two-letter state/province code.countryuses the two-letter ISO code.
You do not need all fields. Email alone provides strong match rates. Adding phone and address improves match quality incrementally.
Enabling in Google Ads
Enhanced Conversions must be enabled per conversion action in Google Ads:
- Go to Goals > Conversions > Summary.
- Select a conversion action and click Edit settings.
- Under Enhanced conversions, toggle on and select your implementation method (Global site tag, GTM, or API).
- Save and verify with the diagnostics report.
GCLID and Auto-Tagging
The Google Click Identifier (GCLID) is a URL parameter that Google Ads appends to your landing page URL when a user clicks an ad. A typical URL looks like:
https://example.com/landing?gclid=EAIaIQobChMI8NLl0...
Auto-tagging is enabled by default in Google Ads. It adds the gclid parameter automatically without modifying your ad URLs. This is the primary mechanism for attributing website conversions back to specific clicks.
Storing GCLID for Offline Use
If you need to import offline conversions (e.g., a lead submits a form online but converts via phone call days later), you must capture and store the GCLID at form submission time.
function captureGclid() {
const params = new URLSearchParams(window.location.search);
const gclid = params.get('gclid');
if (gclid) {
// Store in a cookie for 90 days
const expiry = 90 * 24 * 60 * 60;
document.cookie = `_gcl_aw=${gclid};max-age=${expiry};path=/;SameSite=Lax`;
}
return gclid;
}
// Call on page load
captureGclid();
Then include the GCLID value as a hidden field in your lead forms, and save it to your CRM or database alongside the lead record.
Common GCLID Issues
- GCLID stripped by redirects. If your landing page performs a redirect, the GCLID parameter may be lost. Ensure redirects carry query parameters through.
- URL parameter blocking. Some CMS platforms or CDNs strip unknown query parameters. Whitelist
gclidandgbraid/wbraid(mobile parameters). - Cross-domain loss. If the user clicks an ad, lands on
site-a.com, then navigates tosite-b.comwhere the form lives, the GCLID is lost. Use cross-domain tracking or capture the GCLID on the first domain.
Linking Google Ads with GA4
Linking your Google Ads and GA4 accounts enables bidirectional data flow:
From GA4 to Google Ads:
- Import GA4 conversions as Google Ads conversion actions. This lets you use GA4's event-based model (which may attribute differently than the Google Ads tag) for bidding optimization.
- Share GA4 audiences with Google Ads for remarketing. For example, create an audience of users who viewed a product page but did not purchase, and target them in Google Ads.
From Google Ads to GA4:
- Google Ads campaign data (cost, clicks, impressions) appears in GA4 reports under Acquisition > Traffic acquisition.
- Ad click dimensions (campaign name, ad group, keyword) are available in GA4 for path analysis and funnel reporting.
How to Link
- In GA4, go to Admin > Product links > Google Ads links.
- Click Link and select your Google Ads account.
- Enable auto-tagging in Google Ads (it should already be on).
- Enable Personalized advertising if you want to share audiences.
Once linked, GA4 conversions take up to 24 hours to appear in Google Ads. Imported conversions can be set as primary or secondary conversion actions for Smart Bidding.
Offline Conversion Imports
Offline conversion imports let you attribute conversions that happen outside your website (phone sales, in-store visits, CRM deal closures) back to the original Google Ads click.
The Flow
- User clicks an ad and lands on your site with a GCLID.
- User submits a form. Your backend stores the GCLID with the lead record.
- Days or weeks later, the lead converts (signs a contract, makes a phone purchase).
- You upload the GCLID + conversion time + value to Google Ads.
Upload Format
Google Ads accepts uploads via the UI (CSV) or the Google Ads API. The API payload format:
{
"conversions": [
{
"gclid": "EAIaIQobChMI8NLl0...",
"conversion_action": "customers/1234567890/conversionActions/987654321",
"conversion_date_time": "2026-03-01 14:30:00-05:00",
"conversion_value": 2500.00,
"currency_code": "USD"
}
]
}
Timing Requirements
- Upload conversions within 90 days of the click (the GCLID expires after 90 days).
- There is a processing delay of 1-3 days. Upload conversions at least 24 hours after they occur for accurate attribution.
- For Smart Bidding, upload as frequently as possible (daily is recommended) so the bidding algorithm has fresh data.
Consent Mode
Google Consent Mode v2 adjusts how Google tags behave based on user consent. When a user has not consented to tracking, the tags still fire but send cookieless pings that allow for conversion modeling without storing identifiers.
Default Consent State
Set the default consent state before the Google Tag loads. This should run before gtag('config', ...):
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied'
});
Updating Consent
When the user accepts cookies via your consent banner, update the consent state:
gtag('consent', 'update', {
'ad_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted',
'analytics_storage': 'granted'
});
Consent Parameters
| Parameter | Controls |
|---|---|
ad_storage |
Whether Google Ads cookies (e.g., _gcl_aw) can be read/written |
ad_user_data |
Whether user data can be sent to Google for advertising |
ad_personalization |
Whether data can be used for remarketing/personalization |
analytics_storage |
Whether GA4 cookies can be read/written |
When ad_storage is denied, Google Ads cannot set or read cookies, but the tag still sends cookieless conversion pings. Google uses these pings plus machine learning to model conversions, filling in gaps from unconsented users. Google reports this as "modeled conversions" in your conversion columns.
For EEA traffic, Consent Mode v2 is required to use Google Ads audiences, remarketing, and Enhanced Conversions.
Common Errors
| Error | Cause | Fix |
|---|---|---|
| "No recent conversions" in Google Ads | Tag not firing, GCLID mismatch, or conversion window expired | Verify the tag fires with Google Tag Assistant. Check that auto-tagging is enabled. Confirm the conversion window has not been set too short. |
| "Unverified" conversion action | Google has not detected the tag on your site | Visit the page where the conversion fires while in Tag Assistant preview mode. Ensure the Conversion ID and Label match. |
| "Inactive" conversion tag | No conversions recorded in 7+ days | Check if the tag was removed during a site update. Verify the trigger conditions in GTM are still valid. |
| Duplicate conversions inflating numbers | Missing transaction_id or counting set to "Every" for leads |
Add a unique transaction_id to every conversion call. Switch lead-type actions to "One" counting. |
| Conversions not matching GA4 | Different attribution models or conversion windows | Google Ads uses last-click by default; GA4 uses data-driven. Align the windows or accept the discrepancy as expected. |
| Enhanced Conversions showing "Not collecting data" | User data not being sent or fields improperly formatted | Verify gtag('set', 'user_data', {...}) runs before the conversion event. Check that email is lowercase and phone includes country code. |
| GCLID lost on redirect | Landing page performs a 301/302 that strips query parameters | Configure redirects to preserve all query parameters, or capture the GCLID before the redirect occurs. |
| "Tag fired but no conversion recorded" | Consent Mode blocking cookie storage | Check if ad_storage is set to denied. If consent is denied, conversions will appear as modeled (not real-time) with a 1-3 day delay. |
| Offline import error: "Click not found" | GCLID expired (>90 days) or was from a different Google Ads account | Upload within 90 days. Verify the GCLID belongs to the same account as the conversion action. |
| Conversion value showing as 0 | value parameter missing or passed as a string |
Pass value as a number, not a string. Ensure currency is also set. |
Server-Side Conversion Tracking
Server-side tracking sends conversion data directly from your backend to the Google Ads API, bypassing the browser entirely. This eliminates issues with ad blockers, cookie restrictions, and client-side JavaScript failures.
Two primary approaches:
Google Tag Manager Server-Side Container. Runs on your own infrastructure (Cloud Run, App Engine, or any HTTP endpoint). The client-side GTM container sends events to your server container, which forwards them to Google Ads. This preserves the familiar GTM workflow while moving execution server-side.
Google Ads API direct uploads. Your backend sends conversion data (GCLID, conversion action, value, timestamp) directly to the
ConversionUploadService. This is the same mechanism used for offline imports but can be called in real time at the moment of conversion.
Server-side tracking is particularly effective for high-value conversions (purchases, subscriptions) where accuracy matters more than real-time reporting speed.
Performance Considerations
The Google Tag (gtag.js) adds approximately 70-80 KB (compressed) to the initial page load. To minimize performance impact:
- Load the script with
async(included by default in the snippet). - Avoid placing conversion tracking calls in synchronous
<script>blocks that block rendering. - If using GTM, configure the Google Ads tag to fire on specific triggers rather than "All Pages" when conversion events only occur on certain pages.
- For sites sensitive to Core Web Vitals, consider a GTM server-side container. This moves the gtag.js execution from the client to your server, reducing the main-thread JavaScript on the user's device.
- Use
gtag('config', 'AW-CONVERSION_ID', { 'send_page_view': false })if you only need conversion tracking and not page view data sent to Google Ads.
Related Guides
- Install Google Ads Tag -- Step-by-step tag installation for different platforms
- Google Ads Event Tracking -- Full event reference with standard and custom events
- Cross-Domain Tracking -- Tracking users across multiple domains
- Data Layer Setup -- Structuring your dataLayer for Google Ads and GTM
- Server-Side vs Client-Side -- When to use each approach
- Google Ads Integrations -- Connecting Google Ads with other tools
- Troubleshooting and Debugging -- Diagnosing common tracking issues
- User Management -- Managing account access and permissions