Deploy Google Analytics

 

Google Tag Manager features close integration with Google Analytics. Use Tag Manager to configure and deploy your Google Analytics tag configurations.

Google Analytics Settings variables

The Google Analytics Settings variable is used in Universal Analytics tags in web and mobile (Firebase) containers to centrally configure and share common Google Analytics settings that are used across multiple tags. When you create a Google Analytics tag using Universal Analytics, Tag Manager will prompt you to select or create a Google Analytics Settings variable.

Most users will start off with a Google Analytics Settings variable that contains only a Google Analytics tracking ID. Any additional tag configurations that use that same Google Analytics tracking ID will then be able to leverage the variable, without having to re-enter the ID. Advanced configurations might include custom fields, custom dimensions and metrics, or cross domain tracking, and these settings would be shared by any tag that uses this variable. You can create as many Google Analytics Settings variables as needed, each with their own custom settings that need to be shared across a group of similar tags. Learn more about tag configurations

When you use a Google Analytics Settings Variable with your tag, you can override its settings on a per-tag basis. Use Enable overriding settings in this tag to modify any of the parameters for the given tag only. Use this function to enter a different Google Analytics tracking ID, or enable, disable, or modify any of the supported settings.

Use the override function to have a Google Analytics tag use all of the same settings configured in a Google Analytics Settings Variable, but send the data to a different tracking ID. 
If you consistently override the same settings in the same manner, you should consider creating a new Google Analytics Settings Variable to reduce redundancy.

Creating a new Google Analytics tag

To set up a new Google Analytics tag:

  1. On the Workspace Overview screen, click New Tag. Or from anywhere in your container, click Tags and then New. A new tag definition screen will appear.
  2. Click Tag Configuration and choose Universal Analytics.
  3. Select the desired Track Type. (For example, use Page View on a website to measure which pages your users visit. Use Event if you want to measure a specific interaction, such as a button click on a promotion.)
  4. Select or create a new Google Analytics Settings Variable:
    • To reuse a Google Analytics Settings Variable that has already been set up:
      1. Select the desired variable from the menu. Your Google Analytics Tracking ID and all other settings from that variable will be applied to your tag.
    • To set up a new Google Analytics Settings Variable:
      1. select New Variable….
      2. In the Variable Configuration screen, enter your Google Analytics Tracking ID.
      3. Cookie Domain: If you have no other Google Analytics tags deployed on your site via analytics.js or from Tag Manager, you should leave this value set to "auto". If you have other Google Analytics tags setup on your site or in Tag Manager, you should confirm that the Cookie Domain value is consistent.
      4. If you require additional settings such as setting custom fields, dimensions, metrics, content groups, display advertising features, Enhanced Ecommerce features, or cross domain tracking, click More Settings and configure the relevant fields.
      5. Click Save.
      6. You will be prompted to rename the variable if you have not done so already. You may opt to choose to accept the default setting or enter a name of your own. Click Save to complete the tag setup.
  5. Click Triggering to choose a trigger that will make the tag fire. You may select an existing trigger, or click the + icon to define a new one.

Configure Google Analytics Tags

Google Analytics tags can be configured within Google Tag Manager to have the same functionality as most manual code implementations. (Note: custom Universal Analytics plugins are not currently supported in Google Tag Manager). Configuration settings are found in the More Settings menu:

Fields to set: Hardcoded custom Google Analytics tags use the create() and set() API calls to establish trackers and add custom configurations. Tag Manager uses Fields to Set to replicate this functionality. Use the +Add Field button to create additional Field Name/Value pairs.

Custom Dimensions: Use the +Add Custom Dimension button to add custom dimensions. Provide an Index and Dimension Value for each entry. Learn more about using custom dimensions.

Custom Metrics: Use the +Add Custom Metric button to add custom metrics. Provide an Index and Metric Value for each entry. Learn more about using custom metrics.

Content Groups: Use the +Add Custom Content Group button to add custom content groups. Provide an Index and Content Group for each entry. Learn more about using content groups.

Display Advertising Features: Enables features such as Demographics and Interest Reports, Remarketing, and DoubleClick integration. Note that you must also configure the  corresponding settings in the Google Analytics interface. Learn about display advertising features and their impact on your privacy policy.

Enhanced Ecommerce: Send data that measures ecommerce-related interactions such as when customers have added items to their orders, when they have started the checkout process, and when they have completed a purchase. You can use enhanced ecommerce to identify segments of customers who fall out of the ecommerce funnel. Learn more

Cross Domain Tracking: Track separate, top-level domains as a single entity to combine data for those domains together in the same Google Analytics reports. Learn more about cross domain tracking. Additional options include:

  • Auto Link Domains: Enter a comma-separated list of domains to automatically share a client ID across multiple domains.
  • Use Hash As Delimiter: Use an octothorpe (#) instead of a question mark (?) to append cookie values to URLs. Set this value to true, false, or to a Tag Manager variable that returns either true or false.
  • Decorate Forms: Adds tracking information to the form action. Set this value to true, false, or to a Tag Manager variable that returns either true or false.

Advanced Configuration: These controls provide extended functionality and should be used by experienced users only.

  • Global Function Name: Rename the global function used by the Universal Analytics Tag. Learn more.
  • Use Debug Version: Google Analytics provides a debug version of the analytics.js library that logs detailed messages to the JavaScript console. Set this value to true, false, or to a Tag Manager variable that returns either true or false. Learn more
  • Enable Enhanced Link Attribution: Enhanced Link Attribution improves the accuracy of your In-Page Analytics report. When a page contains multiple links to the same URL, it adds a unique element ID to each link. Set this value to true, false, or to a Tag Manager variable that returns either true or false. Learn more
  • Set Tracker Name: Use of named trackers is highly discouraged in Tag Manager. Learn more

Tag configurations

Once implemented, deploying Google Analytics tags from Google Tag Manager gives you the flexibility of deploying any variety of tag configuration without having to alter the source code of your website or app. Here are some examples of the possible Google Analytics configurations that can be set up from Tag Manager:

  • Basic web page activity: This is the most common implementation of Google Analytics. Select “Page View” for your tag's track type, and set the trigger to fire the tag on all pages.
  • Google Analytics events: You can use Tag Manager to configure and deploy Google Analytics tags that will track specific events, such as clicks on links or buttons on a web page. Learn more
  • Track across domains: Use Tag Manager to track users across multiple domains. Learn more
  • Ecommerce tracking: Track ecommerce events and how to implement enhanced ecommerce.
  • Dynamic remarketing: Implem,ent dynamic remarketing with Google Analytics.

Related resources

Was this article helpful?
How can we improve it?