Google's Global Site Tag
Global Site Tag
In early 2019, Google proactively introduced a new type of pixel now known as the Global Site Tag into Campaign Manager. This is something that would replace the traditional Floodlight tag in a sense, which allowed a container based tag to be implemented across an advertiser's entire site with event based Floodlights being responsible for tagging different events for conversion purposes.
The main reason this was introduced was due to the decline of 3rd party cookies on web browsers. The GST is able to set a 1st party cookie in places, allowing it be more effective in tracking & measurement vs the traditional Floodlight.
It also brought CM as part of the Google Marketing Platform (GMP) much closer to how it's sister tags work i.e.
Google Analytics (gtag.js)
Google Tag Manager (GTM)
All 3 of these tags now operate in a fairly similar way, as you can see in the actual code.
Tag Structure
There are two parts to the Global Site Tag, the global snippet & events.
Global Snippet
The Global Snippet looks like this:
<!--
Start of global snippet: Please do not remove
Place this snippet between the <head> and </head> tags on every page of your site.
-->
<!-- Global site tag (gtag.js) - DoubleClick -->
<script async src="https://www.googletagmanager.com/gtag/js?id=DC-[floodlightConfigID]"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'DC-[floodlightConfigID]');
</script>
<!-- End of global snippet: Please do not remove -->
This should be placed on every page of the advertiser's site, between the <head> </head> tags.
The Floodlight Config ID is the same as the CM Advertiser ID.
If a client is running multiple Google Tags, which can be across other Google properties such as GTM/Google Analytics, it is best practice to combine the Global Site Tag i.e.
<!-- Global Site Tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script><script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments)};
gtag('js', new Date());
gtag('config', 'GA_TRACKING_ID');
gtag('config', 'DC-1234567');
gtag('config', 'AW-1234567');
</script>
where the config is added as a separate line.
Note that the Global Site Tag is currently not supported on:
Mobile App
AMP Pages
Non-Javascript Webpages
Event Snippet
For the event snippet, this is more similar to a standard Floodlight, which consists of different core information such as the activity tag string, activity group string and custom variables.
The code looks like the following:
<!--
Event snippet for Activity Name on http://foo.com: Please do not remove.
Place this snippet on pages with events you’re tracking.
Creation date: 10/30/2017
-->
<script>
gtag('event', 'conversion', {
'allow_custom_scripts': true,
'u1': '[variable]',
'send_to': 'DC-[floodlightConfigID]/[activityGroupTagString]/[activityTagString]+[countingMethod]'
});
</script>
<noscript>
<img src="https://ad.doubleclick.net/ddm/activity/src=[floodlightConfigID];type=[activityGroupTagString];cat=[activityTagString];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=1?" width="1" height="1" alt=""/>
</noscript>
<!-- End of event snippet: Please do not remove -->
Where the u variables are custom variables that should be amended on site / in the tag manager whilst the config / tag string / counting method can be hardcoded prior to implementation.
Most Tag Managers support the Global Site Tag in their own templates, whilst GTM does this by default as long as the tag is created as the right format in CM.
Testing the Global Site Tag
The easiest solution for testing on site is using the Google Tag Assistant which you can download as a chrome extension from here.