Monitor Your Cross-Domain Tracking with Google Tag Manager and Google Analytics Custom Alert

published by on 15th January 2018 under Google Analytics


This post is not about setting up cross-domain tracking for Google Analytics but let’s have a quick reminder on what it is and how to set it up.

Cross-domain tracking is basically adjusting the GA settings to be able to aggregate traffic on and in the same GA property. This is done by allowing the _ga cookie to be shared between these domains. To do this we need to:

  • Append the _ga linker parameter to the destination URL when coming from the origin domain – and vice versa. The _ga linker parameter looks like _ga=1.199239214.1624002396.1440697407 and consists in the GA client id + timestamp + some other special ingredients…It should be generated and appended (automatically with the autoLink method or manually) to the destination URL just before the user gets redirected to the destination URL to prevent any issues related to links sharing. More information on the linker here;
  • Set the allowLinker field to ‘true’ to tell GA to parse the _ga linker parameter;
  • Set the cookieDomain to ‘auto’ (this should already be the case);
  • Add the domains (, in the Referral Exclusion List in your GA property settings.

See here for a simple description on how to do this in GTM.


The Solution

So, to my knowledge, having this _ga linker in the destination URL is the sine qua non condition for your cross-domain tracking to work. No other way around.

Which brings us to the quite simple solution explained below to monitor when this is broken. Yes, even if you initially set it up correctly, cross-domain tracking can be broken for many reasons: an update to the site preventing the autoLink method from working, a redirection or a server-side setting stripping out the _ga linker parameter, etc. And when it’s broken, this is vicious enough for you to notice that only weeks after it actually broke. You would basically see an increase in sessions (as a new session would start when landing on from and in sessions attributed to Direct.

So, to be aware on the day (or the day after) it happens, you can setup the following solution, which requires GTM and consists in:

  • Sending an event to GA when the Page URL is on (or and the referrer is (or and the Page URL doesn’t contains the _ga linker parameter;
  • Setting up a custom alert in GA to let you know if this event has been sent.

To do this we need:

  • A variable for the _ga Linker URL Query
  • A trigger per domains to track (2 in my example)
  • A GA event tag
  • A GA custom alert


1- Create the gaLinker Variable

Go to the variable section in GTM and create the URL type variable as below:

gaLinker variable

You also need to enable the in-built Referrer and Page URL variables if not already done.

2- Create the Google Analytics Event Tag

I’ve added the built-in variables Referrer and Page URL for the event label so I can quickly see where the issue is coming from.

I’ve also chosen to set this event as a non-interaction hit so it doesn’t impact the bounce rate.

GA event for broken cross-domain tracking

3- Create the Triggers

In this example, we have 2 triggers:

- one for broken cross-domain tracking from to
- one for broken cross-domain tracking from to

If you have a third domain, then you’ll need 3 triggers:
- one for broken cross-domain tracking from or to
- one for broken cross-domain tracking from or to
- one for broken cross-domain tracking from or to

The triggers basically check that:

  • The referrer is (or;
  • The destination URL is (or;
  • The _ga linker parameter is not defined in the destination URL.


trigger from domainA to domainB

trigger from domainB to domainA

The entire tag configuration should look like below:

Full tag config


4 – Create the Custom Alert in GA

Now that we have setup this event, we need to create a custom alert in GA so we can receive an email when this event is reported.

So, go to the GA View settings and click on Custom Alerts:

GA Custom Alerts under View settings

Then create the daily alert like below:

GA custom alert

And that’s it.

Hopefully you won’t receive any of those but if you do, you’ll know it and fix it faster!

Related posts

FIRST Is a Google Data Studio Certified Partner

published by on 8th January 2018 under Events, General, Google Analytics

Happy new year all!

And to start this year on a great note, we are happy to announce that FIRST has earned the certification for Google Data Studio.

We have used Google Data Studio since its launch in 2016 and it has quickly become one of our favourite data visualisation tool to share insights and do some data exploration with ease.

Google Analytics Partner


If you haven’t done so yet, have a play with it.

Happy data visualisation!

Related posts

Google Analytics Partner Summit 2017

published by on 11th September 2017 under Digital Trends, Events, Google Analytics, etc

Last month, I attended the Google Analytics Partner Summit, which was held in the prestigious Fairmont hotel in San Francisco. I also spent an additional day immersing myself in Optimize and GTM’s roadmaps. While most announcements are confidential, I can share some features that have been made public at the Google Marketing Next event or that have officially been released recently.


Google products covered during the GACP Summit

Google products covered during the GACP Summit

I must say I’ve been impressed by the amount of new features planned and most importantly by the transparency of Google’s product teams, answering questions on the spot and always eager to get more feedback.


Opening Keynote with Justin Cutroni & Jesse Savage

Opening Keynote with Justin Cutroni & Jesse Savage


During the opening Keynote, Analytics Evangelist Justin Cutroni and GA’s Head of Product Jesse Savage shared some of the main Google’s mid-long term focuses:

  1. Easily gain insights with Google technology and machine learning
  2. Make implementation simpler and open platforms for data and analysis

I believe this summarises the upcoming innovations, including the ones below:



One of the main announcements was the presentation of a new tagging library : gtag.js.

Released last month, the gtag.js library aims at making tagging easier and providing a unified implementation strategy across Google’s conversion tracking, remarketing and site-analytics products.

This update only concerns new on-page GA implementation only, i.e. you don’t have to update your GA tracking code (using analytics.js). And if you have your GA tracking called from GTM, then nothing needs to be changed – gtag.js is not yet supported by GTM anyway.

More info on the gtag.js tagging will be provided in a future post.



The free tier of Attribution, announced during the Google Marketing Next this year, has been confirmed for Q1 2018. Attribution will include the Data-Driven Attribution model, which is currently available to Attribution 360 customers only. Attribution 360 will receive extra features to make attribution insights even more actionable.



Since the Google Analytics Settings variable in May, there hasn’t been a lot of major novelties in GTM, apart from some UI improvements (filtering, searching, pagination, trigger-color triggers). They lately release the ability to use GA Enhanced Ecommerce for Firebase Apps. But the best is still to come with some nice in-built triggers and variables that are very much expected by the community…Watch this space…



Optimize is certainly one of the top priorities for the GA 360 Suite team right now in terms of catching up with competition such as Optimizely or Visual Website Optimizer but the announcements in terms of UI, integration and personalisation will certainly convince more and more experimenters to migrate to Google. Optimize’s roadmap does look impressive!



Since its launch in May 2016, DS has been hugely adopted by GA users (we use A LOT here at FIRST). However until last week, data sources were relatively limited to mainly Google products. Last week, new Community connectors have been added, which allows connecting any online data sources. They are already about 50 connectors available in the gallery and no doubt that the community is going to contribute adding event more connectors in the coming months. This will certainly help getting even more users on board!


These are some of few announcements that we can share right now but of course a lot more were presented. While some “just” focus on making the user experience better, few are bringing analytics and data to the next level, which is very exciting to see!



Below some shots of my Googleplex tour in Mountain view. A special thanks to Chewy, Site Reliability Engineer for leading the tour with so much enthusiasm and Angus, AU/NZ Partner Manager for organizing this all!

From top to bottom: 1- SpaceShipOne & Darth Vader 2-Android OS Cemetery 3-T-Rex 4-Latest Oreo Android OS 5-Google's Main building 6-MIPS per square foot optimization with corkboard server rack...

From top to bottom: 1- SpaceShipOne & Darth Vader 2- Android OS Cemetery 3- T-Rex 4- Latest Oreo Android OS 5- Google’s Main building 6- MIPS per square foot optimization with corkboard server rack…

Cross-device Remarketing with Google Analytics Launching May 15, 2017

published by on 5th April 2017 under Google Analytics, Industry News, Performance Media

Today, you may have seen this notification under your Google Analytics Admin section > Tracking Info > Data Collection:

Cross-device remarketing GA notification

Many of you have been waiting for this for so long!

Finally, advertisers will be able to re-target a user whatever the acquisition device.

Finally, we will be able to continue the conversation and stop assuming they never visited the site before, which sometimes could result in weird/annoying situations where, for instance a mobile user would be asked to complete his/her purchase while he/she actually just did it earlier on his/her desktop…

OK users still have to be logged-in to his/her Google account and allow Google to access their browsing activity for advertising purpose, but this is still a huge progress towards better, smarter retargeting.
User experience should be improved too!

Can’t wait to see that in action.

Below the full message about this update:

GA Remarketing Update

Google Analytics Desktop UI Roll Out – New Improvements and Design

published by on 14th February 2017 under General, Google Analytics

The New Google Analytics Desktop UI


If you’ve logged into GA since Friday 10th, you sure have noticed the GA user interface got a new look. The changes on the Google Analytics Desktop UI have been announced by Google in October 2016 and have now been rolled out to everyone.

Although not groundbreaking, there are a few changes worthy to know.

Continue reading