Setup a Google Analytics Tracking ID variable in GTM

Create a Google Analytics tracking ID variable in GTM under User-Defined Variables. Just select configuration 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, then feel free to drop in below comment box. If you find this article helpful, please consider sharing it with your network.

Also, please subscribe to our restoreBin YouTube channel for helpful videos.

Disclosure: This page may contain affiliate links, which means we may receive compensation for your purchases using our links; of course at no extra cost to you (indeed, you may get special discounts). This will support our effort to create more useful content, and keep it open and free forever.

Leave a Reply

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