Google Analytics settings variable

 

Creating a Google Analytics Settings Variable with Google Tag Manager

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

Create a Google Analytics settings variable

To create a new Google Analytics Settings variable:

  1. Click Variables.
  2. Under the User-Defined Variables heading, click New.
  3. Click Variable Configuration and select Google Analytics Settings (located under the Utilities heading).
  4. Enter your Google Analytics ID in the Tracking ID field.
  5. For most implementations, leave "Cookie Domain" set to auto.
  6. Save the tag.

How to find the Google Analytics ID

To find the Google Analytics ID:

  1. Sign in to your Analytics account.
  2. Click Admin.
  3. Select an account from the menu in the ACCOUNT column.
  4. Select a property from the menu in the PROPERTY column.
  5. Under PROPERTY, click Tracking Info > Tracking Code. Your ID is displayed at the top of the page.

If you already have Universal Analytics tags setup in Tag Manager or on your site, you should make sure the cookie domain is named consistently across those tags. The default value for the Cookie Domain field is "auto", which enables Google Analytics to automatically determine the best cookie domain to use. For most implementations, there is no need to modify this setting. Only adjust the value if you have a specific need to do so. Learn more.

Additional considerations

Most users will start off with a Google Analytics Settings variable that contains only a Google Analytics ID. Any additional tag configurations that use that same Google Analytics ID will then be able to leverage the variable, without having to re-enter the ID. Advanced configurations might include custom fields, custom dimensions, custom metrics, or cross domain measurement, 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.

You can override the functionality of a Google Analytics Settings variable on a per-tag basis. Use Enable overriding settings in this tag to modify any of the parameters for the given tag.

If you consistently override the same settings in the same manner, you should consider creating a new Google Analytics Settings Variable to reduce redundancy.

Related resources

Was this article helpful?
How can we improve it?