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.

Install

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());

gtag('config',AW-CONVERSION_ID');

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:

 gtag('config',AW-CONVERSION_ID')

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:

2019-08-13_21-50-24.png

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

2019-08-13_21-51-51.png

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

Floodlight

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. 

2019-08-13_21-56-34.png

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:

2019-08-13_22-00-31.png

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:

2019-08-13_22-05-22.png

2019-08-13_22-06-09.png

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

Version history
Last update:
3 weeks ago
Updated by: