Google Analytics Settings Variable in Google Tag Manager

In this article I will show how to create and use the ‘Google Analytics Settings’ variable in Google Tag Manager:

google analytics settings variablePrerequisites

I have written this article under the assumption that you are familiar with, how Google Tag Manager and its variables work.

Classic Google Analytics Tags in Google Tag Manager

You can create different types of tags in Google Tag Manager (GTM). These tag types could be: ‘Universal Analytics’, ‘Classic Google Analytics’, ‘Adwords Conversion Tracking’, ‘Custom HTML’ etc

GTM tag typesIn GTM there are tags that are based on ‘Classic Google Analytics’.

We call such tags ‘Classic Google Analytics’ tags. In order to maintain backward compatibility, such tag type is still available in GTM.

You can select this tag type while creating a new tag in Google Tag Manager or while editing an existing tag:

classic google analytics tag

The Classic Google Analytics tags are used to send hits (pageviews, event, transaction etc) to the Google Analytics server using ‘ga.js’ JavaScript library:

classic GA hits

Each Tag of type ‘Classic Google Analytics’ has got its own set of settings which can be viewed/changed by clicking on the ‘More Settings’ and ‘Advanced Settings’ links while creating a new ‘Classic GA’ tag or editing an existing ‘Classic GA tag’:

classic ga settings

classic ga settings2

‘Basic Configuration’, ‘Campaign Tracking’, ‘Campaign Variables’, ‘Domains and Referrers’ etc are examples of Generic Google Analytics settings.

gtm 101

Get the E-Book (100 Pages)

 

CSS selectors in Google Tag Manager


Get the FREE E-Book (62 Pages)

In most cases, all of these settings need to be set and maintain with same configuration options across all tags of type ‘Classic Google Analytics’.

But this need to be done manually for each tag because the ‘Google Analytics Settings’ variable through which you can set, change and apply Google Analytics Generic settings across all tags from one central location is not available for ‘Classic Google Analytics’ tags.

The ‘Google Analytics Settings’ variable in Google Tag Manager is available only for ‘Universal Analytics’ tags in the: ‘web’, ‘Android’ and ‘IOS’ GTM containers. This variable is not available in the ‘AMP’ GTM container:

amp gtm container

Related Article: Difference between Google Analytics and Universal Analytics

So if you are using ‘Classic Google Analytics’ on your website or any tag of type ‘Classic Google Analytics’ then you would first need to migrate your existing tracking from Google Analytics to Universal Analytics before you can use and take advantage of the ‘Google Analytics Settings’ variable in GTM.

Related Article: Migrating from Google Analytics to Universal Analytics

Universal Analytics Tags in Google Tag Manager

As the name suggests, Universal Analytics tags have got the tag type ‘Universal Analytics’. You can select this tag type while creating a new tag in Google Tag Manager or while editing an existing tag:

universal analytics tag 1

Universal Analytics tags are used to send hits (pageviews, event, transaction etc) to Google Analytics server using analytics.js JavaScript library and they support the ‘Google Analytics Settings’ variable:

universal analytics hits

Remember, the ‘Google Analytics Settings’ variable is available only for ‘Universal Analytics’ tags. It is not available for any other tag type.

Each Tag of type ‘Universal Analytics’ has got its own set of settings which can be viewed/changed by clicking on the ‘More Settings’ and ‘Advanced Settings’ links while creating a new ‘Universal Analytics’ tag or editing an existing ‘Universal Analytics’ tag:

universal analytics settings

universal analytics settings2

In most cases, all of the configuration options under ‘More Settings’ (like ‘Fields to Set’, ‘Custom Dimensions’, ‘Custom Metrics’, ‘Content Groups’, ‘Ecommerce’ etc) need to be set and maintain for all tags of type ‘Universal Analytics’. Manually updating each and every ‘Universal Analytics’ tag to make sure all such tags have got same basic configuration options is time consuming and not practical esp. if you have got dozens or even hundreds of  ‘Universal Analytics’ tag.

Here the ‘Google Analytics Settings’ variable comes in handy. Through this variable you can set, change and apply any or all of the configuration options under ‘More Settings’ (like ‘Fields to Set’, ‘Custom Dimensions’, ‘Custom Metrics’, ‘Content Groups’, ‘Ecommerce’ etc) from one central location to all tags of type ‘Universal Analytics’.

It is important to remember that through theGoogle Analytics Settings’ variable you can not set, change and apply any or all of the configuration options under ‘Advanced Settings’ (like ‘Tag firing priority, ‘Tag firing options’, ‘Tag Sequencing’ etc):

not advanced settings

Methods to Create Google Analytics Settings Variable in Google Tag Manager

There are two methods that you can use to create Google Analytics Settings Variable in Google Tag Manager:

#1 You can create a new Google Analytics Settings variable from within any tag of type ‘Universal Analytics’. Just edit the tag and then click on the ‘New Variable…’ option from the ‘Google Analytics Settings’ drop-down menu:

new variable

#2 Navigate to the ‘Variables’ section in your GTM container and then create a new user-defined variable of type ‘Google Analytics Settings’:

user defined variable gtm

How to Create a new Google Analytics Settings Variable

Follow the steps below:

Step-1: Login to your Google Tag Manager account and then edit the tag (of type Universal Analytics) whose generic settings you want to use across all other tags of type ‘Universal Analytics’. Most likely this would be tag you used to install ‘Universal Analytics’ on your website.

Step-2: Note down the ‘tracking ID’:tracking id 1

Later, you will use this ‘tracking ID’ while creating a ‘Google Analytics Settings’ variable.

Step-3: Click on the ‘More Settings’ link to see the current settings for your Universal Analytics tag:

more settings universal analytics

Take a note of these settings. Later, you will use the same settings while creating a ‘Google Analytics Settings’ variable.

Step-4: Create a new ‘User-defined variable’ of type ‘Google Analytics Settings’.

Step-5: Name the settings variable and enter your tracking ID:

name settings variable gtm

The ‘cookie domain’ field is pre-populated with the value ‘auto’.

‘auto’ is a configuration parameter that automatically setup cross-domain tracking between the primary domain and its sub-domain(s).

Step-6: Click on the ‘More Settings’ link and then use the same settings you note down earlier for one of your ‘Universal Analytics’ tag:

settings variable more settings 1

Step-7: Once you have copied all the settings from your ‘Universal Analytics’ tag to your ‘Google Analytics Settings’ variable then click on the ‘Save’ button. You have now created a new Google Analytics settings variable which store generic settings for your universal analytics tags.

Note: You can create several Google Analytics Settings variables.

Configuring a Universal Analytics Tag to use Google Analytics Settings Variable

Step-1: Edit a tag of type ‘Universal Analytics’ and then select the new ‘Google Analytics Settings’ variable from the ‘Google Analytics Settings’ drop-down menu:

settings variable drop down menu

Step-2: Click on the ‘Save’ button to save the new setting for your tag.

Step-3: Repeat step 1 and 2 for each tag of type ‘Universal Analytics’.

Note: You can use only one Google Analytics settings variable at a time for a Universal Analytics tag.

Configuring a Universal Analytics Tag to Use Google Analytics Settings Variable but Override Some of the Fields

You can configure a Universal Analytics tag to use Google Analytics settings variable and at the same time override some of the fields with custom values. To do that follow the steps below:

Step-1: Edit the universal analytics tag which use the Google Analytics settings variable.

Step-2: Click the checkbox named ‘Enable overriding settings in this tag’ in order to override individual fields from the settings variable in the tag and then add custom values to the fields you want to override:

overriding individual fields

Step-3: Click on the ‘Save’ button to save the tag with new settings.

Step-4: Repeat steps 1 to 3 for each universal analytics tag for which you want to use the Google Analytics settings variable but at the same time override some of the fields/settings with custom values.

Note: The fields which are not overridden continue to use the settings defined by the Google Analytics settings variable.

How to Find Which Tag Settings have Inherited Their Values from Google Analytics Settings Variable and Which Haven’t

When a universal analytics tag is configured to use the ‘Google Analytics Settings’ variable then all its fields under the ‘More Settings’ section along with ‘tracking ID’ and ‘cookie domain’ fields inherit values from the ‘Google Analytics Settings’ variable (unless they are manually overridden with custom values).

In order to find the fields of a Universal Analytics tag that have inherited values from the ‘Google Analytics Settings’ variable, follow the steps below:

Step-1: Edit the universal analytics tag which use the Google Analytics settings variable.

Step-2: Click the checkbox named ‘Enable overriding settings in this tag’ (if it is not already checked).

Step-3: Click on the ‘More Settings’ link.

Step-4: Check each setting one by one and look for the text ‘Inherited from setting variable’:

inherited from settings variable

Any field whose default value is ‘Inherited from setting variable’ has inherited its value from the Google Analytics Settings variable. 

Configuring a Universal Analytics Tag Without Using Google Analytics Settings Variable

It is not mandatory to use the Google Analytics Settings variable. You can choose to keep/set all GA settings manually for any/all tag, of type ‘Universal Analytics’. When you create/edit a tag of type ‘Universal Analytics’ and you want to completely ignore the ‘Google Analytics Settings’ variable then do the following two things:

#1 Choose ‘Select Settings Variable…’ menu option from the ‘Google Analytics Settings’ drop-down menu and then click on the checkbox ‘Enable overriding settings in this tag

select settings variable

#2 Enter your GA property ID, click on ‘More Settings’ link and then add the various GA settings manually:

without settings variable

Note: In order to maintain backward compatibility, the checkbox named ‘Enable overriding settings in this tag’ is selected by default for all universal analytics tags which are currently not configured to use the ‘Google Analytics Settings’ variable. However if you are creating a new universal analytics tag, then the checkbox named ‘Enable overriding settings in this tag’ is not selected by default.

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade
error: Alert: Content is protected !!