Use the global site tag for Floodlight conversion tracking and remarketing

About the global site tag

To ensure that Search Ads 360 can measure all of your conversions regardless of the browser that your site visitor is using, use the global site tag  (gtag.js) as the format for your Floodlight activity tags. This tag sets new cookies on your domain, which will store a unique identifier for a user or the ad click that brought the user to your site. The cookies receive the ad click information from a GCLID (“Google click identifier”) parameter that is included in the conversion tracking tags. Learn how to opt out of setting first-party cookies on your site’s domain.

This article provides details on using the global site tag for Floodlight activities.

Benefits of the global site tag

  • Faster and easier integration with other Google products: The global site tag is not only used by Google Marketing Platform products, but also by other Google products such as Google Ads and Google Analytics. If you use these products, the global site tag makes website implementation easier by providing a unified tagging experience.

  • More accurate conversion tracking: Using the global site tag sets new cookies on your domain, which will store a unique identifier for a user or the ad click that brought the user to your site. This ensures that Floodlight can measure conversions more accurately.

  • If you use Floodlight iframe or image tags, we recommend you migrate to the global site tag or use Google Tag Manager with the Conversion Linker. Floodlight iframe and image tags are not able to observe all of your conversions.

Since the global site tag is able to use the information from the new cookies that are set on your domain, please ensure you're providing users with clear and comprehensive information about data collection, and obtaining consent where legally required.

How the global site tag works

A global site tag for Floodlight is made of two snippets of JavaScript:

  • Global snippet

  • Event snippet

Global snippet

The global snippet should be placed on all pages of your website, in the <head> section of your HTML pages. Here's an example of the global snippet in a global site tag:

<!-- 
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-1234567"></script>
<script>
 window.dataLayer = window.dataLayer || [];
 function gtag(){dataLayer.push(arguments)};
 gtag('js', new Date());

 gtag('config', 'DC-1234567');
</script>
<!-- End of global snippet: Please do not remove -->

The code snippet above is an example only and won’t work on your website. When you set up a Floodlight activity, you’ll be able to view and copy the global site tag for your account. Learn about the fields and other information in a global snippet.

Event snippet

The event snippet should be installed on the page with the event you're tracking. It can be placed anywhere on the page after the global snippet. For the best tracking accuracy, place the snippet within the <head> section just after the global snippet.

Here’s an example of an event snippet:

<!--
Event snippet for Thank You on http://www.example.com/thanks: Please do not remove.
Place this snippet on pages with events you’re tracking. 
Creation date: 11/01/2017
-->
<script>
 gtag('event', 'purchase', {
   'allow_custom_scripts': true,
   'value': '[Revenue]',
   'transaction_id': '[Order ID]',
   'send_to': 'DC-1234567/group1/thank123+transactions',
   'u1': '[Custom Floodlight variable]'
 });
</script>
<noscript>
<img src="https://ad.doubleclick.net/ddm/activity/src=1234567;type=group1;cat=thank123;
qty=1;cost=[Revenue];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;tfua=;npa=;
ord=[Order ID]?" width="1" height="1" alt="">
</noscript>
<!-- End of event snippet: Please do not remove -->

The code snippet above is an example only and won’t work on your website. When you set up a Floodlight activity, you’ll be able to view and copy the event tag for your account. Learn about the fields and other information in an event snippet.

Using the global site tag for multiple Google products

The global site tag can be configured to send data to multiple Google products. For example, if you use Google Analytics, Google Ads conversion tracking, and Search Ads 360, you only need one global site tag on every page of your site. For each product, you add a 'config' command to the global snippet, so Google knows how to route your data. Each conversion or event you want to track will have its own event snippet. Learn how to create a global site tag that tracks conversions for both Search Ads 360 and Google Ads.

Cookies set by the global site tag

The global site tag sets new cookies on your domain that will store a unique identifier for a user or the ad click that brought the user to your site. The cookies receive the ad click information from a GCLID (“Google click identifier”) parameter that Google Ads adds to the landing page URL just before redirecting to your site.

How to opt out

If you don’t want the global site tag to set first-party cookies on your site’s domain, add the highlighted portion below to your global snippet’s config command:

gtag('config', 'DC-1234567', {'conversion_linker': false});

We don’t recommend doing this as it will lead to less accurate conversion measurement.

What is the difference between Google Tag Manager and global site tag?

Google Tag Manager and global site tag are separate and independent ways of tagging your website.

If you want to manage Google and third party tags from a single location without modifying your site’s code in the future, use Google Tag Manager.

If you would like to code tags on your site directly using JavaScript, use the global site tag.

Was this article helpful?
How can we improve it?