Setup a Google Analytics Tracking ID variable in GTM permanently

You can create a Google Analytics tracking ID variable in GTM by scrolling down to User Defined Variables in Variables Tab and hit on New button command to select configuration as Google Analytics Settings utility and input the GA tracker ID in the field.

I personally use Google Tag Manager (GTM) for deploying tags and trigger on my blog. The GTM provides me with the flexibility to deploy unlimited tags and snippets without actually modifying the <head> tag at every instance.

GTM also provides the ability to store information in variables that can be queried while building a GTM tag. One of the best features is creating a permanent Google Analytics tracking ID variable, and call it whenever required in every trigger.

In order to create and define a GA variable in GTM, follow the below simple steps:

  1. Login to Google Tag Manager account
  2. Access the container, select the workspace, and navigate to the “Variables” tab
  3. Scroll to the bottom section which says “User-Defined Variable” and hit on New button
  4. Enter a recognizable name, say “GA – Tracking ID”
  5. Hit on configuration¬†Choose variable type…¬†to Google Analytics Settings
  6. Enter the Property Tracking ID [how to find?]
    GTM Variable Setting for GA Tracking ID
  7. Make any advanced settings (if required but optional) and hit on Save button
  8. That’s all! Your GTM variable with GA Tracking ID is ready for use

How to use this tracking ID?

Whenever you create a new GTM tag with Universal Analytics tag type, you’ll get an option saying “Google Analytics Settings”, from dropdown just select the Analytics tracking variable that we created in the last step.
Google Analytics Settings GTM Tag

How flexible is using this variable?

Suppose your website is migrating to a different GA Tracking ID, but you want to keep all the tags and triggers intact. You just need to modify the variable tracking ID that we set up in step #6.

All the tags and triggers will automatically consider this new adjusted Property ID without manually modifying every tag — time saver and flexible, isn’t it? I personally use this pre-defined custom variable for an obvious reason. I also have a GTM tag setup to send internal link clicks as GA Event.

I hope you’ll also consider using the constant variable. Let me know your thoughts and ideas on it. Cheers!

If you've any thoughts on Setup a Google Analytics Tracking ID variable in GTM permanently, then feel free to drop in below comment box. Also, please subscribe to our restoreBin YouTube channel for amazing videos tips. Cheers!

BrowserHow logo
Kushal Azza
I've keen interest in exploring the latest tech and gadgets. A digital development and analytics consultant. Also, a geek behind this website/blog!

Leave a Reply

Your email address will not be published. Required fields are marked *