Learn the best practices for setting up Conversion Tracking with Google Marketing Tags (gtag.js): Google Ads and Floodlight.

In this article:

Table of Contents Placeholder

How it Works

A conversion occurs when an ad click or other interaction with your ad leads directly to a behavior that's valuable to your business. Conversions are measured with conversion tracking.

Conversion tracking is a tool that measures how clicks on your ads lead to valuable customer activity on your website, such as purchases, sign-ups, and form submissions.

The global site tag (gtag.js) is a JavaScript tagging framework and API that sends event data to multiple Google products.  This tag is needed for conversion tracking in your website.


Typically, setting up website conversion tracking requires adding 2 code snippets to your website: the global site tag and the configuration call for each tag.  The benefit of using Tealium iQ Tag Management is that the Google Marketplace Tags install and load both the global site tag and the configuration call within one Tag Template.

Global Site Tag

The global site code, included in all gtag.js tags, appears in the following format:

<!-- Global site tag (gtag.js) - Google Ads: CONVERSION_ID -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-CONVERSION_ID"></script>

Tealium iQ Tag Management's installs and loads the global site tag on all pages of a domain. Only one global site tag is needed for each Google Ads account.

Configuration Call

The following code snippet is the configuration call for each tag, where AW-CONVERSION_ID is the conversion ID that’s unique to your Google Ads account:

window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());


It is recommended that all Google global site tags have a load rule of "all pages". This configuration call sets the relevant cookies used by Google, such as  gclid and _ga, and also helps Google avoid Intelligent Tracking Prevention (ITP), by not reading the cookie value on the conversion pages.

The following line, from the code snippet, activates the configuration call:


Event Triggers

Customers may have multiple Google global site tag products, such as Google Ads and Floodlight. It is best practice to use event triggers for the global site tag to run on all pages where a conversion event fires.

Google Ads

In Google Ads, the conversion event happens each time the Conversion Label field is set in the Tag Configuration screen of Tealium iQ Tag Manager. 

It is best practice to leave this field blank and to dynamically populate the event snippet using an extension on the conversion event, (such as a Set Data Values extension), coupled with a data mapping, as shown in the following example:


The following shows an example of using the Set Data Values extension:


Learn more about using the global site tag for Google Ads conversion tracking.


For sales Floodlight tags, the purchase event automatically fires if the E-Commerce extension is set up and an order ID is populated. The default counting method with this event is set to transactions. 


For counter Floodlight tags (tags that have a Standard, Unique or Per Session counting method), set up a conversion trigger for the Floodlight tag to execute the event snippet on each page:


hotwire _ main 2021-03-01 12-36-54.png

This logic sets the UDO Variable fire_floodlight to true if the page_name is PDP. If the variable fire_floodlight is true , then trigger a conversion event.

If you want to fire the conversion page on all pages, in your Floodlight configuration, use a "Custom Value" to set a static mapping to avoid the use of a Set Data Values extension as shown in the following example:



With this logic in place, the Floodlight tag always triggers the conversion event. 

Version history
Last update:
3 weeks ago
Updated by: