What This Does
When someone clicks on your Google Ad (or Facebook Ad, etc.) and visits your main website, then clicks through to your event landing page on our platform, we need to make sure that booking conversions are properly attributed back to the original ad that brought them to you.
Without this setup:
User clicks your Google Ad → visits your website → books on the landing page
❌ Google Ads doesn't see the conversion (you're wasting ad spend!)
With this setup:
User clicks your Google Ad → visits your website → books on the landing page
✅ Google Ads records the conversion (you can see which ads are working!)
This works for:
✅ Google Ads
✅ Facebook & Instagram Ads
✅ Microsoft Ads
✅ TikTok Ads
✅ LinkedIn Ads
Note: This is an advanced-level technical setup. If you would like someone from our team to help, feel free to contact us for support
Before You Start
Ensure you first follow this guide on setting up tracking for your landing page or tracking when using a widget on your own website
What You'll Need
Access to your Google Tag Manager account
5 minutes to complete the setup
Your event landing page domain (e.g.,
the-big-events-company.eventrac.co.uk)
Step-by-Step Instructions
Step 1: Open Google Tag Manager
Go to tagmanager.google.com
Select your website's container
Click "Tags" in the left sidebar
Step 2: Create a New Tag
Click the "New" button (top right)
Click on "Tag Configuration" box
Scroll down and select "Custom HTML"
Step 3: Copy and Paste the Code
Copy the code below and paste it into the HTML box:
html
<script>
(function() {
// Step 1: Capture tracking IDs from the URL when visitors arrive
var urlParams = new URLSearchParams(window.location.search);
var clickIds = ['gclid', 'fbclid', 'msclkid', 'ttclid', 'li_fat_id'];
clickIds.forEach(function(param) {
var value = urlParams.get(param);
if (value) {
localStorage.setItem('_saved_' + param, value);
console.log('Captured ' + param + ': ' + value);
}
});
// Step 2: Add these tracking IDs to links going to your event landing pages
var savedParams = {};
clickIds.forEach(function(param) {
var saved = localStorage.getItem('_saved_' + param);
if (saved) {
savedParams[param] = saved;
}
});
// Only proceed if we have tracking parameters to add
if (Object.keys(savedParams).length > 0) {
// IMPORTANT: You may need to replace "eventrac.co.uk" if you use a custom domain for your eventrac landing page
document.querySelectorAll('a[href*="eventrac.co.uk"]').forEach(function(link) {
try {
var url = new URL(link.href);
// Add each tracking parameter to the link if not already present
Object.keys(savedParams).forEach(function(param) {
if (!url.searchParams.has(param)) {
url.searchParams.set(param, savedParams[param]);
}
});
link.href = url.toString();
} catch (e) {
// Ignore any malformed URLs
}
});
console.log('Landing page links decorated with tracking parameters');
}
})();
</script>
Note: If using a custom domain for your landing page, you will need to repalce the eventrac.co.uk URL with yours above
Step 4: Set the Trigger
Click on "Triggering" box (below the HTML code)
Click the "+" icon in the top right
Click on the trigger box that appears
Select "All Pages"
Click "Save" (top right)
Step 5: Name and Save Your Tag
Click on the tag name at the top (it says "Untitled Tag")
Rename it to: "Cross-Domain Ad Tracking"
Click "Save" (top right)
Step 6: Publish Your Changes
Click "Submit" (top right, blue button)
Add a description like: "Added cross-domain ad tracking for event bookings"
Click "Publish"
How to Test That It's Working
Quick Test (2 minutes):
Add test parameter to your website URL
Visit your website and add
?gclid=test123to the endExample:
https://yourwebsite.com?gclid=test123
Check your browser console
Right-click anywhere → Inspect → Console tab
You should see:
Captured gclid: test123
Find a link to your event landing page
Right-click on the link → Inspect
Look at the
href- it should now include?gclid=test123Example:
https://yourcustomer.eventrac.co.uk?gclid=test123
Success! ✅
If you see the tracking parameter in the link, it's working correctly
Real-World Test (After Running Ads):
Click on one of your actual Google Ads
Navigate through your website
Click a link to your event landing page
Complete a test booking
Wait 24-48 hours
Check Google Ads → Conversions
You should see the conversion recorded ✅
Troubleshooting
I don't see any tracking parameters in my links
I don't see any tracking parameters in my links
Check these things:
Is the tag published?
GTM changes only work after clicking "Submit" → "Publish"
Are you testing with a tracking parameter?
Add
?gclid=test123to your URL before checking links
Clear your browser cache
Sometimes old code gets cached
Try in an Incognito/Private window
Do you have links to the landing pages on the page you're testing?
The code only decorates links that exist on the page
Navigate to a page that has a "Book Now" or event registration link
My links look weird with lots of parameters
My links look weird with lots of parameters
This is normal! A link might look like:
https://yourcustomer.eventrac.co.uk?gclid=abc123&fbclid=xyz789
These parameters are invisible to your customers and necessary for accurate tracking.
"I'm still not seeing conversions in Google Ads"
Check these:
Wait 24-48 hours - Conversions take time to appear in Google Ads
Verify your GA4/Google Ads conversion setup - The conversion action must be configured in Google Ads
Check if you have actual ad traffic - No clicks = no conversions to track
Make sure customers are actually completing bookings - Test the full booking flow yourself
Verify the purchase event is firing - Check in GA4 → Realtime → Events while completing a test booking
I'm still not seeing conversions in Google Ads
I'm still not seeing conversions in Google Ads
Check these:
Wait 24-48 hours - Conversions take time to appear in Google Ads
Verify your GA4/Google Ads conversion setup - The conversion action must be configured in Google Ads
Check if you have actual ad traffic - No clicks = no conversions to track
Make sure customers are actually completing bookings - Test the full booking flow yourself
Verify the purchase event is firing - Check in GA4 → Realtime → Events while completing a test booking
What Happens Behind the Scenes
When someone clicks your ad, platforms like Google add a special tracking code to the URL (called gclid, fbclid, etc.).
The problem: When they navigate from your website to your event landing page, this tracking code gets lost because they're crossing to a different domain.
The solution: This code automatically:
Saves the tracking code when visitors arrive on your site
Adds it back to all links pointing to your event landing pages
Preserves the connection between the ad click and the final booking
This means platforms like Google Ads can see the complete journey and credit the conversion to the right ad!
Support
If you run into any issues or have questions:
💬 Live Chat: Contact
🗓️ Book A Meeting: Book a meeting with one of our experts
Technical Details (Optional Reading)
What tracking parameters does this capture?
gclid- Google Ads clicksfbclid- Facebook & Instagram adsmsclkid- Microsoft Ads (Bing)ttclid- TikTok adsli_fat_id- LinkedIn ads
Where is data stored?
In your visitor's browser (localStorage)
Data expires when they close their browser
No personal information is collected
Fully GDPR compliant (stores only anonymous ad click IDs)
Does this slow down my website?
No - the code is lightweight and runs asynchronously
Typical execution time: <5 milliseconds
No impact on page load speed or user experience
