• Internet Marketing
    • Google Analytics
    • Google Tag Manager
    • SEO
    • Content
    • Marketing Automation
    • Social Media
    • PPC
  • Technology
    • Mobile
    • ISP
    • Hosting
    • Tools & Services
  • Resources
    • Useful And Unique Sites
    • Google Analytics Referral Spam Filters
    • Google Analytics URL Builder for Custom UTM Codes
  • Contact
www.gregcruce.com
  • Internet Marketing
    • Google Analytics
    • Google Tag Manager
    • SEO
    • Content
    • Marketing Automation
    • Social Media
    • PPC
  • Technology
    • Mobile
    • ISP
    • Hosting
    • Tools & Services
  • Resources
    • Useful And Unique Sites
    • Google Analytics Referral Spam Filters
    • Google Analytics URL Builder for Custom UTM Codes
  • Contact
Google Analytics Tracking ID As A Variable In Google Tag Manager
19 July 2015

Set Your Google Analytics Tracking ID As A Variable In Google Tag Manager

Written by Greg Cruce
Google Tag Manager Comments are off
Share

This is a great tip and one that is used frequently! Setting up your Google Analytics Tracking ID as a Google Tag Manager variable is a fast, easy way to roll out updates to any account, as well as test Google Tag Manager integrations on a live site without tampering with data.  More on that later – for now, let’s get started.

Create A New Variable -> Constant

First, you’ll want to create a new Constant – that’s because our Tracking ID should be absolute and never subject to any programmatic changes.

Create a new variable, give it a descriptive name, and then add in your Tracking ID as the value.

Google Analytics ID As A GTM Constant

Use Our Variable In Every GA Tag And Event

When creating any Google Analytics tags or events, for the Tracking ID, use a variable:

Google Tag Manager - use Tracking ID As A Variable

Two Awesome Uses For This

  1. Sites that are live with Google Analytics, but need to migrate to Google Tag Manager. Simply create a dummy Google Analytics account, paste in the dummy Tracking ID as your new GTM variable, and use the variable for each and every GA tag and event. In this instance, a site can already be live with Google Analytics and the dummy GTM & GA account allows you to test your integration in a separate property to ensure everything is tracking. As you prepare to go live, update the GTM variable containing the dummy Google Analytics Tracking ID with the real Tracking ID (and remove the old Google Analytics account code from the site!), and you’ve got an effortless rollout.
  2. Sites that are in development, and cannot push data to a live Google Analytics profile. This happens a lot as well – an existing site is live and tracking while a new site is in development. The goal is to seamlessly transition to Google Tag Manager when the new site launches.  Just as above, create a dummy Google Analytics account, paste in the dummy Tracking ID as your new GTM variable, and test your in-development site for tagging. Just before launch, replace the dummy Tracking ID with the real Tracking ID, and you’ve got another smooth GTM integration.

Got any tips for using Google Tag Manager variables?  I’d love to hear about them below in the comments!

Join other digital marketers who have a head start

Free online marketing tips and resources delivered to your inbox

No charge. Unsubscribe anytime

Google Analytics Event Tracking, Google Analytics Tracking ID, Google Tag Manager Variables
Greg Cruce

Greg has over 20 years of combined experience in the disciplines of web development, computer programming, IT, and Internet marketing and strategy. This unique skillset allows for powerful insights from consulting, strategy, execution and analysis.

www.gregcruce.com

The professional blog by Greg Cruce, an Internet and Digital Marketing professional.

  • About Me
  • Subscribe to RSS
  • Connect via LinkedIn
  • Connect via Twitter

Posts

  • Google Analytics Cohort AnalysisGoogle Analytics Cohort Analysis - What Is It?
    Google Analytics Cohort Analysis – What Is It?
  • How To Use Google Analytics: Get Started With Your Website
    How To Use Google Analytics: Get Started With Your Website
  • Data Layer Push for Google Tag Manager
    Using dataLayer.push? Include An Event To Fire Tags in Google Tag Manager

Services

  • Google Analytics Consulting
copyright www.gregcruce.com