Tags

A tag is snippet of JavaScript that sends information to a third party, such as Google. If you don't use a tag management solution such as Google Tag Manager, you need to add these snippets of JavaScript directly to the source code of your site. In contrast, with Google Tag Manager, you no longer need to maintain each of these JavaScript snippets in your source code; instead, you specify the tags that you want to fire, and when you want them to fire, in the Google Tag Manager user interface.

In Google Tag Manager, you can deploy a tag via a template for the specific tag, or, if a template is not available for the tag you want to deploy, via a custom tag into which you can place your tag JavaScript. Google Tag Manager offers:

Templates for Supported Google and DoubleClick Tags

Google Tag Manager explicitly supports the following tag types, with templates that minimize the possibility of errors in your tags.

AdWords Conversion Tracking Tag

To set up this tag in Google Tag Manager, you'll need to supply the Conversion ID, Conversion Label, and Conversion Value.

  1. In your AdWords account, navigate to Tools and Analysis > Conversions. Click the Code tab.
  2. Select an action name on the left and select "I make changes to the code". In the code box:

    • Find the value of “google_conversion_id = “ and enter it into Conversion ID.
    • Find the value of “google_conversion_label = “ and enter it into Conversion Label.
    • (Optional) Find the value of “google_conversion_value = “ and enter it into Conversion Value. If you'd like to populate a value dynamically, select a macro from the dropdown menu (or create a new one).

Add a rule so that the tag fires on your desired conversion page. Name the rule after the conversion page; for example, “PDF Download Conversion Page”. This will allow you to easily identify and reuse the rule in other tags.

Learn more about AdWords Conversion Tracking.

DoubleClick Floodlight Counter Tag

The DoubleClick Floodlight Counter tag allows you to count the number of times that users have visited a particular page after seeing or clicking one of your ads. There are two ways to add Floodlight tags to a container:

  • accept a tag that has been pushed from the DoubleClick Campaign Manager user interface
  • add the tag from the Google Tag Manager user interface.

Accepting a Pushed Floodlight Tag

This tag can be pushed directly to your container from the DoubleClick Campaign Manager user interface. To allow this in Google Tag Manager, you need to approve the link request and pushed tag(s). Read Approvals to learn more. To learn how to push tags from DoubleClick Campaign Manager, read Add Floodlight activities to Google Tag Manager containers.

To accept a pushed Floodlight tag, navigate to Approval Queue > Tags. Click the activity name. A few of the parameters (e.g. the values for "src= ", "type= ", and "cat= ") will be pre-set.

Floodlight custom variables are key-values that can be used to track data that you collect about your users, for example the genre of movie that a user purchases. Custom Floodlight variables use the keys u1=, u2=, etc. For pushed tags, macro names will be pre-populated in the custom variable fields; you will need to configure these macros the retrieve the appropriate data.

Make desired modifications to the tag, then click Approve.

Adding the Tag in Google Tag Manager

Select DoubleClick Floodlight Counter as the Tag Type.

  • Find the value of “src= “ and enter it into Advertiser ID.
  • Find the value of “type= “ and enter it into Group Tag String.
  • Find the value of “cat= “ and enter it into Activity Tag String.

Floodlight custom variables are key-values that can be used to track data that you collect about your users, for example the genre of movie that a user purchases. Custom Floodlight variables use the keys u1=, u2=, etc. For each custom variable, select a macro that contains the value you want to pass to the variable.

Once you have completed entering the tag information, click Save.

Learn more about the DoubleClick Floodlight Counter tag.

DoubleClick Floodlight Sales Tag

The DoubleClick Floodlight Sales tag allows you to keep track of how many items users have purchased, as well as the total value of those purchases. There are two ways to add Floodlight tags to a container:

  • accept a tag that has been pushed from the DoubleClick Campaign Manager user interface
  • add the tag from the Google Tag Manager user interface.

Accepting a Pushed Floodlight Tag

This tag can be pushed directly to your container from the DoubleClick Campaign Manager user interface. To allow this in Google Tag Manager, you need to approve the link request and pushed tag(s). Read Approvals to learn more. To learn how to push tags from DoubleClick Campaign Manager, read Add Floodlight activities to Google Tag Manager containers.

To accept a pushed Floodlight tag, navigate to Approval Queue > Tags. Click the activity name. A few of the parameters (e.g. the values for "src= ", "type= ", and "cat= ") will be pre-set.

For pushed tags, the Revenue parameter is pre-populated with a {{cost}} macro. You'll need to create and configure a {{cost}} macro that retrieves the revenue amount.

Also, the Order ID parameter is pre-populated with a {{ord}} macro. You'll need to create and configure an {{ord}} macro. This macro should retrieve the order ID (or, if Item Sold is the Counting Method, a count of the number of items sold.)

Floodlight custom variables are key-values that can be used to track data that you collect about your users, for example the genre of movie that a user purchases. Custom Floodlight variables use the keys u1=, u2=, etc. For pushed tags, macro names will be pre-populated in the custom variable fields; you will need to configure these macros the pull the appropriate data.

Make desired modifications to the tag, then click Approve.

Adding the Tag in Google Tag Manager

Select DoubleClick Floodlight Sales as the Tag Type.

  • Find the value of “src= “ and enter it into Advertiser ID.
  • Find the value of “type= “ and enter it into Group Tag String.
  • Find the value of “cat= “ and enter it into Activity Tag String.

For the Revenue parameter, select a macro that contains the revenue amount. For Order ID, select a macro that contains the order ID. If you have selected Item Sold as the Counting Method, select a macro that contains a count of the number of items sold. You will need to create these macros in Google Tag Manager if you have not already created them.

Floodlight custom variables are key-values that can be used to track data that you collect about your users, for example the genre of movie that a user purchases. Custom Floodlight variables use the keys u1=, u2=, etc. For each custom variable, select a macro that contains the value you want to pass to the variable.

Once you have completed entering the tag information, click Save.

Learn more about the DoubleClick Floodlight Sales tag.

Google Analytics Tag

To find the Web Property ID:

  • In your Google Analytics account, navigate to Admin.
  • Click Property Settings.

Enter the Tracking ID (which takes the form of UA-xxxxxx-xx) into the Web Property ID field.

You can also use a macro in the Web Property ID field, which is helpful if you're managing multiple Google Analytics properties.

To enable Display Advertising features, including Demographics and Interest Reports, Remarketing, and DCM Integration, select the Display Advertiser Support checkbox. If you select this option, review the Policy requirements for Display Advertising.

Google Tag Manager supports the following Google Analytics tags:

You have the option of providing additional settings (under More Settings):

  • Basic Configuration
    • Anonymize IP Addresses: info
    • Virtual Page Path: indicates the page path to track metrics under. info
    • Set sample rate: info
    • Set session cookie timeout: info
  • Campaign Tracking:
    • Allow Anchor: info
    • Set campaign cookie timeout: info
  • Custom Variables: info
  • Domains and Directories:info
    For example, when tracking across domains A.com to B.com, you would need to configure B.com to use the cookie data from the URL parameter (from the A.com session), instead of setting/using its own cookies. To enable this linking, select the Allow Linker checkbox.
  • Search Engines and Referrers: info
  • Advanced Configuration:
    • Tracker Name: Allows you to name the tracker object yourself. Note: Naming the tracker object yourself is discouraged. If you inadvertently reuse an existing tracker object name, your data may become corrupted. Although providing a name for the tracker can allow you to share state between Google Tag Manager-created trackers and your pre-existing Google Analytics code, you should instead update the code on your site to use the Google Tag Manager dataLayer syntax. Otherwise you will be unable to configure your tracking via Google Tag Manager.
    • Local GIF Path: info
    • Visitor Cookie Timeout: info
    • Hit Callback: The value of this field should point to a macro that will return a function. This function will be called when the Google Analytics tracking beacon is completely sent.
    • Enable Enhanced Link Attribution: info
    • Enable Browser Tracking Module: info
    • Enable Flash Detection: info
    • Enable Title Detection: info
    • Send Hits to Google Servers: If you set a local GIF path, hits will be sent to a server that you own. Selecting this option will also send hits to Google.

Basic Tracking

For basic Google Analytics tracking, add a single Google Analytics tag and select “Page View” as the track type. Add a rule to fire the tag on all pages. If basic tracking is all you need, you’ll just add this single Google Analytics tag. However, if you track events or ecommerce transactions, you’ll need to add additional Google Analytics tags.

Tracking Google Analytics Events

Read Google Analytics Events for examples.

Tracking Across Domains

Read Cross Domain Tracking for examples.

Universal Analytics Tag

The Universal Analytics (beta) tag is a new version of the Google Analytics tracking tag. Universal Analytics introduces a set of features that change the way data is collected and organized in your Google Analytics account.

With Universal Analytics, you can collect more types of data and improve your data quality, so you can get a better understanding of how visitors interact with your business at every stage — advertising, sales, product usage, support, and retention.

Installing Universal Analytics via Google Tag Manager is an ideal way to implement, as making changes in the future will be much easier.

To find the Web Property ID:

  • In your Google Analytics account, navigate to Admin.
  • Click Property Settings.

Enter the Tracking ID (which takes the form of UA-xxxxxx-xx) into the Web Property ID field.

You can also use a macro in the Web Property ID field, which is helpful if you're managing multiple Google Analytics properties.

Google Tag Manager supports the following Google Analytics tags:

You have the option of providing additional settings:
  • Basic Configuration
    • Anonymize IP Addresses: info
    • Session Control: info
    • Document Referrer: info
    • Document Path: info
    • Document Title: info
    • Sample Rate: info
  • Advanced Configuration
    • Global Function Name info
  • Cookie Configuration
  • Cross Domain Tracking: Auto Link Domains: separate multiple domains with commas, e.g. A.com, B.com, C.com ( See Cross Domain Tracking for usage example.)
  • Custom Dimensions: info
  • Custom Metrics: info
  • Fields to set: For example, when tracking across domains A.com to B.com, you would need to configure B.com to use the cookie data from the URL parameter (from the A.com session), instead of setting/using its own cookies. To enable this linking, enter
    Field Name: allowLinker
    Value: true

Basic Tracking

For basic Google Analytics (Universal Analytics) tracking, add a single Google Analytics (Universal Analytics) tag and select “Page View” as the track type. Add a rule to fire the tag on all pages. If basic tracking is all you need, you’ll just add this single Google Analytics (Universal Analytics) tag. However, if you track events or ecommerce transactions, you’ll need to add additional Google Analytics (Universal Analytics) tags.

Tracking Google Analytics Events

Read Google Analytics Events for examples.

Tracking Across Domains

Read Cross Domain Tracking for examples.

GDN Remarketing Tag

To set up the Google Display Network remarketing tag in Google Tag Manager, you'll need to supply the Conversion ID and Conversion Label.

  1. In your AdWords account, click the Campaigns tab.
  2. In your campaign list on the left, click Shared library > Audiences.
  3. Find the list created for you, called "Main List." Then, click [Tag] under the "Tags/Definitions" column.
  4. Click the "Tag" link. In the code box:

    • Find the value of “google_conversion_id = “ and enter it into the Conversion ID field.
    • Find the value of “google_conversion_label = “ and enter it into Conversion Label field.

Read Setting Up AdWords Dynamic Remarketing for detailed instructions. Learn more about the remarketing tag.

Templates for Certified Vendor Tags

In addition to the templates for Google and DoubleClick tags, templates for the following tags are also available. This list will be regularly updated as additional templates become available. To use a template, simply select it, provide the requested details, and Google Tag Manager automatically generates the correct code.

Custom Tag Types

The following two custom tag types are provided, which allow you to copy and paste code from virtually any tag. If you need to implement a tag that is not explicitly supported via a template, you can use one of these tag types.

Custom Image Tag

The Custom Image Tag type allows you to manage an image tag that is not listed as a Tag Type option. For example, if you use an invisible one-pixel image for tracking, enter the image URL. To insert macros, wrap the macro name in double braces, i.e. {{macro_name}}. Select “//” if protocol-relative versions of the image are available; select “https://” if only a secure version is available. “http://” is not recommended.

Select the Cache Buster checkbox and provide a cache busting parameter to ensure that hits are registered from browsers that have cached versions of the image.

Custom HTML Tag

The Custom HTML Tag type allows you to manage a tag that isn't explicitly supported via a Google Tag Manager template, for example, a non-Google tag. (Learn about tag restrictions.)

Copy and paste your HTML/Javascript into the textbox. Be sure to enclose Javascript snippets inside HTML script tags. You may incorporate calls to document.write() in your tags.

To insert macros into your custom HTML tag, wrap the macro name in double braces, i.e. {{macro_name}}. This can be helpful for tag reuse in multiple contexts.

Add tags independently instead of combining them. For example, if you have two data collection tools side by side in your original site code, break these two tools into two separate Custom HTML tags. Doing so will allow you to independently deploy each tag.

Specify rules for when the tag should fire. Once you name and save the tag, you'll be able to manage it using Google Tag Manager.