Mastering Google Ads Offline Conversion Tracking with GTM: A Step-by-Step Advanced Guide
Margub Alam
GA4 & Web Analytics Specialist | Google Tag Manager | Digital Analytics Consultant | Web Analyst | Mixpanel? - Product Analytic | Amplitude Analytics| CRO | Advanced Pixel Implementation
In an increasingly digital world, businesses still generate valuable leads and conversions offline—through phone calls, in-store purchases, or CRM-driven sales. Google Ads Offline Conversion Tracking (OCT) bridges the gap between online ad interactions and offline revenue by linking ad-click data to offline conversions. This ensures more precise measurement of campaign performance and enables better optimization.
Step 1: Understanding Offline Conversion Tracking
Google Ads OCT works by matching a Google Click ID (GCLID) or Enhanced Conversions for Leads (EC4L) data captured during an online interaction with later offline conversion events.
Key Requirements:
- Google Ads Account with admin access.
- GTM implementation for tracking form submissions and storing GCLID.
- CRM system that collects lead data.
- Google Ads API access (or Google Ads UI for manual uploads).
- Enhanced Conversions for Leads (EC4L) for improved match rates (optional but recommended).
Step 2: Capturing GCLID via GTM
1. Set Up a GCLID Capture Mechanism
Google Ads appends a unique GCLID to the URL when a user clicks on an ad. To store it:
- Create a first-party cookie to store the GCLID.
- Use GTM to extract GCLID from the URL and save it in local storage.
GTM Setup to Capture GCLID
- Create a First-Party Cookie Variable in GTM:
- Navigate to Variables > User-Defined Variables > New.
- Select First Party Cookie as the type.
- Name it gclid.
2. Create a Custom JavaScript Variable to Store GCLID in a Cookie
function() {
var urlParams = new URLSearchParams(window.location.search);
var gclid = urlParams.get('gclid');
if (gclid) {
document.cookie = "gclid=" + gclid + "; path=/; expires=Fri, 31 Dec 9999 23:59:59 GMT";
}
return gclid;
}
- Create a Trigger to Fire on All Pages
- Go to Triggers > New
- Select Page View as the trigger type.
- Fire on All Pages.
2. Add a Tag to Run the Script
- Go to Tags > New > Custom HTML.
- Paste the above script.
- Select the trigger you just created.
- Save and publish changes.
Step 3: Sending GCLID to CRM
Ensure your lead forms capture and send GCLID to your CRM when users submit forms. Modify your form fields to include a hidden field that dynamically retrieves GCLID.
Example Hidden Field in HTML Form:
<input type="hidden" name="gclid" id="gclid" value="">
<script>
document.getElementById("gclid").value = (document.cookie.match('(^|;)\s*gclid\s*=\s*([^;]+)')||[])[2] || '';
</script>
This ensures the GCLID is submitted along with the lead details to the CRM.
Step 4: Upload Offline Conversions to Google Ads
Once a conversion happens offline (e.g., after a phone call or CRM update), you need to upload conversion data to Google Ads.
Option 1: Manual Upload via Google Ads
- Go to Google Ads > Tools & Settings > Conversions.
- Click Uploads > + Uploads.
- Download the CSV template and fill it with:
- Google Click ID (GCLID)
- Conversion Name (matches Google Ads setup)
- Conversion Time
- Conversion Value (optional)
4. Upload the file and process conversions.
领英推è
Option 2: Automate with Google Ads API
For advanced users, use the Google Ads API to automate uploads from your CRM.
- Requires Google Ads API credentials.
- Use Google’s Offline Conversion Upload API endpoint.
- Format data using JSON payloads.
Step 5: Enhanced Conversions for Leads (EC4L) via GTM
To improve conversion matching, Enhanced Conversions for Leads (EC4L) enables you to send hashed first-party data (email, phone, etc.) to Google Ads for improved attribution.
GTM Setup for EC4L
- Enable Enhanced Conversions in Google Ads.
- Capture first-party lead data (email, phone) in a form.
- Hash PII data before sending to Google Ads.
- Create a GTM Tag for Enhanced Conversions.
Custom JavaScript to Hash Email (SHA-256)
function() {
var email = {{Email Variable}};
if (email) {
return sha256(email.trim().toLowerCase());
}
return '';
}
- Use this to pass a hashed email variable to Google Ads via GTM.
Step 6: Testing & Troubleshooting
Testing GCLID Capture
- Visit your website from a Google Ad click.
- Check if gclid is stored in cookies/local storage.
- Submit a form and verify if the CRM stores GCLID.
Validating Offline Uploads
- Check Google Ads Conversion Status after uploading.
- Use the Google Ads Debugging Tool to confirm valid GCLID matches.
Debugging Common Issues
Conclusion
Setting up Google Ads Offline Conversion Tracking via GTM significantly improves ad performance measurement and optimization. By leveraging GCLID tracking, Enhanced Conversions for Leads (EC4L), and Google Ads API automation, you ensure accurate attribution of offline conversions, leading to better budget allocation and campaign efficiency.
Implement these advanced strategies today to bridge the online-to-offline attribution gap and maximize your Google Ads ROI!
I’m passionate about empowering organizations with data-driven decision-making while respecting user privacy.
Here’s how you can connect with me or view my work:
Upwork Profile: Upwork
Freelancer Profile: Freelancer
My Blog on GTM & Website Analytics: Google Tag Manager Solution
If you or someone in your network is looking for an experienced professional in this space, I’d love to connect and chat further!