Deploy Google Analytics with Tag Manager

Create a Google Analytics Page View Tag with Google Tag Manager

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

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, custom dimensions, custom 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.

Tag implementations

Here are some examples of the possible Google Analytics tag configurations that can be set up from Tag Manager:

  • Basic web page activity: This is the most common implementation of Google Analytics. Set Track Type to “Page View”, and in the Triggering section select a trigger that will fire on all pages.
  • Track 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: Implement dynamic remarketing with Google Analytics to show your users ads that contain products and services that they previously viewed.

Configuration settings for 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 Tag Manager). Configuration settings are found in the Google Analytics settings variable configuration, or can be set at the tag level in Enable overriding settings in this tag and then More Settings:

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.

Enable Display Advertising Features: Enables the displayfeatures plugin for advertising features such as Demographics and Interest Reports, Remarketing, and Google Marketing Platform integration. Note that you must also configure the corresponding settings in the Google Analytics interface, and enabling this feature in your tags is optional. To override this field and the property settings to turn off Advertising Reporting Features, under Fields to set, add a field titled allowAdFeatures and assign it a value of false. 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
Was this article helpful?
How can we improve it?