Google Analytics (gtag.js) Tag Setup Guide
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.
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
Navigate to the Tag Marketplace to add a new tag. Read the Tag Overview article for general instructions on how to add a tag.
When 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-XXXXXX-13
- Use a comma-separated list to send data for multiple properties.
Enable App + Web by including the measurement ID in the Tracking ID value. For example; UA-XXXXXX-13,G-XXXXXXXXXX
- 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.
- A comma-separated list of domains to use with Cross-Domain Tracking (
- Cross-Domain Tracking
- Sets the value for
setAllowLinker
and enables the cross-domain tracking plug-in. - To use this feature, one or more domains must be specified in the “Cross-Tracking Domains” field or be mapped to
crossDomainTrack
.
- Sets the value for
- Transport Type
- Specifies the transport mechanism with which hits are sent.
- Allow 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.
- Setting this to Off disables all advertising, reporting, and remarketing features, overrides any property settings established in the Google Analytics user interface.
- 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 and 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 plug-in. - This ID is found in your Optimize accounts page.
- Example: GTM-XXXXXX
- Sets the
- 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.
- By default, the data layer initiated and referenced by the global site tag is named
- Allow Anchor
- When true, the
_ga
parameter is added to the query portion of the URL rather than the anchor portion ("#").
- When true, the
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 |
|
transport_type |
|
page_title |
|
page_location |
|
page_path |
|
cookie_name |
|
cookie_domain |
|
cookie_expires |
|
cookie_prefix |
|
cookie_update |
|
config.allow_google_signals |
|
allow_ad_personalization_signals |
|
config.link_attribution.cookie_name |
|
config.link_attribution.cookie_expires |
|
config.link_attribution.levels |
|
config.campaign.id |
|
config.campaign.name |
|
config.campaign.source |
|
config.campaign.medium |
|
config.campaign.content |
|
config.campaign.term |
|
config.anonymize_ip |
|
clear_global_vars |
|
config.optimize_id |
|
config.use_amp_client_id |
|
config.sample_rate |
|
config.site_speed_sample_rate |
|
customer_id |
|
config.client_id |
|
Event
Variable | Description |
---|---|
event_name |
|
event.event_category |
|
event.event_label |
|
event.value |
|
event.name |
|
event.description |
|
event.non_interaction |
|
event.fatal |
|
event.search_term |
|
event.method |
|
event.content_type |
|
event.content_id |
|
event.destination |
|
event.start_date |
|
event.end_date |
|
event.custom |
|
event.anonymize_ip |
|
event.send_to |
|
event.event_callback |
|
App / Screen tracking
Variable | Description |
---|---|
screen_view |
|
event.screen_name |
|
config.app_name |
|
config.app_id |
|
config.app_version |
|
IDconfig.app_installer_id |
|
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 20 |
– Premium Dimension– | |
dimension21 - dimension200 |
Dimension 21 through Dimension 100 |
Metrics
Variable | Description |
---|---|
metric1 |
Metric 1 |
metric2 |
Metric 2 |
metric3 |
Metric 3 |
metric4 |
Metric 4 |
metric5 |
Metric 5 |
metric6 |
Metric 6 |
metric7 |
Metric 7 |
metric8 |
Metric 8 |
metric9 |
Metric 9 |
metric10 |
Metric 10 |
metric11 |
Metric 11 |
metric12 |
Metric 12 |
metric13 |
Metric 13 |
metric14 |
Metric 14 |
metric15 |
Metric 15 |
metric16 |
Metric 16 |
metric17 |
Metric 17 |
metric18 |
Metric 18 |
metric19 |
Metric 19 |
metric20 |
Metric 20 |
– Premium Metric– | |
metric21 - metric200 |
Metric 21 through Metric 200 |
Enhanced E-Commerce
Variable | Description |
---|---|
checkout_step |
|
checkout_option |
|
order_currency |
|
order_id |
|
order_total |
|
order_shipping |
|
order_tax |
|
order_store |
|
order_coupon_code |
|
customer_id |
|
product_id |
|
product_name |
|
product_brand |
|
product_category |
|
product_variant |
|
product_unit_price |
|
product_quantity |
|
product_discount |
|
product_promo_code |
|
product_action_list |
|
product_list_name |
|
product_list_id |
|
product_list_position |
|
product_location_id |
|
Enh E-Comm engagement
Variable | Description |
---|---|
impression_id |
|
impression_name |
|
impression_category |
|
impression_brand |
|
impression_variant |
|
impression_price |
|
impression_list_name |
|
impression_item_list_id |
|
impression_list_position |
|
promo_id |
|
promo_name |
|
promo_creative_name |
|
promo_creative_slot |
|
promo_location_id |
|
App+Web travel
Variable | Description |
---|---|
event.trip_type |
|
start_date |
|
end_date |
|
origin |
|
destination |
|
flight_number |
|
travel_class |
|
fare_product |
|
booking_code |
|
event.passengers.total |
|
event.passengers.adult |
|
event.passengers.child |
|
event.passengers.infant_in_lap |
|
event.passengers.infant_in_seat |
|
App+Web game
Variable | Description |
---|---|
event.achievement_id |
|
event.character |
|
event.group_id |
|
event.item_name |
|
event.level |
|
event.level_name |
|
event.score |
|
event.success |
|
event.virtual_currency_name |
|
IAB Transparency and Consent Framework v2
Variable | Description |
---|---|
gtag_enable_tcf_support |
|
Google Analytics 4 support
Google Analytics 4 (GA4) is currently supported through the App and Web mappings for this tag.
This page was last updated: May 5, 2021