This article describes how to set up the Google Analytics (gtag.js) tag in your Tealium iQ Tag Management account.

Google Analytics provides APIs to collect, configure, and report on user-interactions with your online content. Using gtag.js lets you benefit from the latest tracking features and integrations as they become available.

In this article:

Table of Contents Placeholder

Tag Tips

  • Use mappings to:
    • Dynamically override the E-Commerce extension values
    • Setup event triggers
    • Add custom Metrics, Dimensions, and Content Groups
  • Replace cst in custom event variables with your desired event name
  • Supports the following E-Commerce extension values:
    •  Order ID
    • Order Total
    • Shipping Amount
    • Tax Amount
    • Store
    • Promo Code
    • Customer ID
    • List of Product IDs
    • List of Names
    • List of Brands
    • List of Categories
    • List of Prices
    • List of Quantities
    • List of Discounts

Tag Configuration

First, go to Tealium's tag marketplace and add the Google Analytics (gtag.js) tag (Learn more about how to add a tag).

After adding the tag, configure the following settings:

  • Tracking ID
    • Tracking ID of the Google Analytics property to which you want to send data
    • Example: UA-12345678-1
    • Use a comma-separated list to send data for multiple properties.
  • Global Object
    • The name of the Global Object used for the event queue.
    • If not specified, "gtag" is used.
    • Not required for most implementations.
  • Cross-Tracking Domains
    • A comma-separated list of domains to use with Cross-Domain Tracking (setAllowLinker).
    • To use this list, Cross-Domain Tracking must be set to true.
    • Should be the top level domain, such as tealiumiq.com.
  • Cross-Domain Tracking
    • Sets the value for setAllowLinker and enables the cross-domain tracking plugin.
    • To use this feature, one or more domains must be specified in the "Cross-Tracking Domains" field or be mapped to crossDomainTrack.
  • Display Advertising Features
    • Enables Google Analytics to collect data about your traffic via the Google Ad Manager (DoubleClick) cookie, in addition to data collected through the standard Google Analytics implementation.
  • Enhanced Link Attribution
    • If unsure, use the default value (false).
    • Google Analytics provides enhanced link attribution to improve the accuracy of report data by:
      • Automatically differentiating between multiple links to the same URL on a single page.
      • Using link element IDs.
  • Track Screen Views
    • Enables App/Screen tracking.
    • When enabled, a separate screenview request is sent after the initial pageview.
  • Anonymize IP
    • Tells Google Analytics to anonymize the information sent by the tracker objects by removing the last octet of the IP address prior to its storage.
    • Slightly reduces the accuracy of geographic reporting.
  • Clear Vars
    • Clears items usually set for the lifetime of the tracker after each tracking request.
  • Optimize Container ID
    • Sets the optimize_id and enables the Google Optimize plugin.
    • This ID is found in your Optimize accounts page.
    • Example: GTM-XXXXXX
  • Use AMP Client ID
    • The Google AMP Client ID allows you to uniquely identify users that engage with your content on AMP and non-AMP pages.
    • If you opt-in, Google Analytics uses the AMP Client ID to determine that multiple site events belong to the same user when those users visit AMP pages via a Google AMP viewer.
  • Data Layer Name
    • By default, the data layer initiated and referenced by the global site tag is named dataLayer.
    • Only rename the data layer if your project requires a separate name.

Data Mappings

Mapping is the process of sending data from a data layer variable to the corresponding destination variable of the vendor tag. For instructions on how to map a variable to a tag destination, see Data Mappings.

The available categories are:

Standard

Variable Description
tracking_id
  • Tracking ID
  • Tracking ID of the Google Analytics property to which you want to send data
  • Example: UA-12345678-1
  • Use a comma-separated list to send data for multiple properties.
config.page_title
  • Page Title
config.page_location
  • Page Location

config.page_path

  • Page Path
config.cookie_name
  • Cookie Name

config.cookie_domain

  • Cookie Domain

config.cookie_expires

  • Cookie Expires
config.linker.accept_incoming
  • Boolean
  • Cross-Domain Tracking
  • Sets the value for setAllowLinker and enables the cross-domain tracking plugin.
  • To use this feature, one or more domains must be specified in the "Cross-Tracking Domains" field or be mapped to crossDomainTrack.
config.linker.domains
  • Array
  • Cross-Tracking Domains 
  • A comma-separated list of domains to use with Cross-Domain Tracking (setAllowLinker).
  • To use this list, Cross-Domain Tracking must be set to true.
  • Should be the top level domain, such as tealiumiq.com.
config.allow_display_features
  • Boolean
  • Display Advertising Features
  • Enables Google Analytics to collect data about your traffic via the Google Ad Manager (DoubleClick) cookie, in addition to data collected through the standard Google Analytics implementation.
config.link_attribution.cookie_name
  • Link Attribution Cookie Name
config.link_attribution.cookie_expires
  • Link Attribution Cookie Expiration
config.link_attribution.levels
  • Link Attribution Levels
config.campaign.id
  • Campaign ID
config.campaign.name
  • Campaign Name
config.campaign.source
  • Campaign Source
config.campaign.medium
  • Campaign Medium
config.campaign.content
  • Campaign Content
config.campaign.term
  • Campaign Term/Keyword
config.anonymize_ip
  • Boolean
  • Anonymize IP
  • Tells Google Analytics to anonymize the information sent by the tracker objects by removing the last octet of the IP address prior to its storage.
  • Slightly reduces the accuracy of geographic reporting.
clear_global_vars
  • Boolean
  • Clear Vars 
  • Clears items usually set for the lifetime of the tracker after each tracking request.
config.optimize_id
  • Optimize Container ID
  • Sets the optimize_id and enables the Google Optimize plugin.
  • This ID is found in your Optimize accounts page.
  • Example: GTM-XXXXXX
config.use_amp_client_id
  • Boolean
  • Use AMP Client ID
  • The Google AMP Client ID allows you to uniquely identify users that engage with your content on AMP and non-AMP pages.
  • If you opt-in, Google Analytics uses the AMP Client ID to determine that multiple site events belong to the same user when those users visit AMP pages via a Google AMP viewer.

config.sample_rate

  • Sample Rate
config.site_speed_sample_rate
  • Site Speed Sample Rate
customer_id
  • User ID
  • Overrides _ccustid
config.client_id
  • Client ID

Event

Variable Description

event_name

  • Event Action

event.event_category

  • Event Category

event.event_label

  • Event Label

event.value

  • Event / Timing Value

event.name

  • Timing Variable Name

event.description

  • Exception Description

event.non_interaction

  • Non-Interaction
event.fatal
  • Boolean
  • Fatal Error

event.search_term

  • Search Term

event.method

  • Method

event.content_type

  • Content Type

event.content_id

  • Content ID

event.destination

  • Destination
event.start_date
  • Start Date
  • Date format is YYYYMMDD.
event.end_date
    • End Date
<meta charset="utf-8" />
  • Date format is YYYYMMDD.

event.custom

  • Custom Event Data
event.anonymize_ip
  • Boolean
  • Anonymize IP
  • Tells Google Analytics to anonymize the information sent by the tracker objects by removing the last octet of the IP address prior to its storage.
  • Slightly reduces the accuracy of geographic reporting.

event.send_to

  • Override Default Routing

App / Screen Tracking

Variable Description
screen_view
  • Boolean
  •  
  • Track Screen Views
  • Enables App/Screen tracking.
  • When enabled, a separate screenview request is sent after the initial pageview.

event.screen_name

  • Screen Name

config.app_name

  • Application Name

config.app_id

  • Application ID

config.app_version

  • Application Version
IDconfig.app_installer_id
  •  Application Installer 

Content Groups

Variable Description
 content_group1 Content Group 1
 content_group2 Content Group 2
 content_group3 Content Group 4
 content_group4 Content Group 4
 content_group5 Content Group 5

Dimensions

Variable Description
dimension1 Dimension 1
dimension2 Dimension 2
dimension3 Dimension 3
dimension4 Dimension 4
dimension5 Dimension 5
dimension6 Dimension 6
dimension7 Dimension 7
dimension8 Dimension 8
dimension9 Dimension 9
dimension10 Dimension 10
dimension11 Dimension 11
dimension12 Dimension 12
dimension13 Dimension 13
dimension14 Dimension 14
dimension15 Dimension 15
dimension16 Dimension 16
dimension17 Dimension 17
dimension18 Dimension 18
dimension19 Dimension 19
dimension20 Dimension 120
-- Premium Dimension-- 0
dimension21 - dimension200 Dimension 21 through Dimension 100

Metrics

Variable Description
metric1 metric1
metric2 metric2
metric3 metric3
metric4 metric4
metric5 metric5
metric6 metric6
metric7 metric7
metric8 metric8
metric9 metric9
metric10 metric10
metric11 metric11
metric12 metric12
metric13 metric13
metric14 metric14
metric15 metric15
metric16 metric16
metric17 metric17
metric18 metric18
metric19 metric19
metric20 metric20
-- Premium Metric-- 0
metric21 - metric200 metric21

Enhanced E-Commerce

Variable Description
Checkout Step (checkout_step) [Number]
Checkout Option (checkout_option)
Currency (order_currency) (Overrides _ccurrency)
Order ID (Transaction ID) (Overrides _corder)
Value/Order Total (order_total) (Overrides _ctotal)
Shipping Amount (order_shipping) (Overrides _cship)
Tax Amount (order_tax) (Overrides _ctax)
Affiliation/Store (order_store) (Overrides _cstore)
Promo Code/Coupon (order_coupon_code) (Overrides _cpromo)
User ID (customer_id) (Overrides _ccustid)
List of IDs (product_id) (Overrides _cprod) [Array]
List of Names (product_name) (Overrides _cprodname) [Array]
List of Brands (product_brand) (Overrides _cbrand) [Array]
List of Categories (product_category) (Overrides _ccat) [Array]
List of Variants (product_variant) [Array]
List of Prices (product_unit_price) (Overrides _cprice) [Array]
List of Quantities (product_quantity) (Overrides _cquan) [Array]
List of Discounts (product_discount) (Overrides _cdisc) [Array]
List of Promo Codes/Coupons (product_promo_code) [Array]
Product Action List (product_action_list) [Array]
Product Position (product_list_position) [Array]
Product Name (product_list_name) [Array]

Enh E-Comm: Engagement

Variable Description
Product Impression ID (impression_id) [Array]
Product Impression Name (impression_name) [Array]
Product Impression Category (impression_category) [Array]
Product Impression Brand (impression_brand) [Array]
Product Impression Variant (impression_variant) [Array]
Product Impression Price (impression_price) [Array]
Product Impression List (impression_list_name)
Product Impression Position (impression_list_position) [Array]
Promotion ID (promo_id) [Array]
Promotion Name (promo_name) [Array]
Promotion Creative (promo_creative_name) [Array]
Promotion Position (promo_creative_slot) [Array]