{"id":1249,"date":"2015-07-19T11:00:26","date_gmt":"2015-07-19T15:00:26","guid":{"rendered":"http:\/\/www.gregcruce.com\/?p=1249"},"modified":"2016-07-05T09:03:28","modified_gmt":"2016-07-05T13:03:28","slug":"set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager","status":"publish","type":"post","link":"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/","title":{"rendered":"Set Your Google Analytics Tracking ID As A Variable In Google Tag Manager"},"content":{"rendered":"

This is a great tip and one\u00a0that 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. \u00a0More on that later – for now, let’s get started.<\/p>\n

Create A New Variable -> Constant<\/h2>\n

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.<\/p>\n

Create a new variable, give it a descriptive name, and then add in your Tracking ID as the value.<\/p>\n

\"Google<\/p>\n

Use Our Variable In Every GA Tag And Event<\/h2>\n

When creating any Google Analytics tags or events, for the Tracking ID, use a variable:<\/p>\n

\"Google<\/p>\n

Two Awesome Uses For This<\/h2>\n
    \n
  1. Sites that are live with Google Analytics, but need to migrate to Google Tag Manager<\/strong>. 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.<\/li>\n
  2. Sites that are in development, and\u00a0cannot push data to a live Google Analytics profile<\/strong>. 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. \u00a0Just 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.\u00a0Just before launch, replace the dummy Tracking ID with the real Tracking ID, and you’ve got another smooth GTM integration.<\/li>\n<\/ol>\n

    Got any tips for using Google Tag Manager variables? \u00a0I’d love to hear about them below in the comments!<\/p>\n","protected":false},"excerpt":{"rendered":"

    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.<\/p>\n","protected":false},"author":1,"featured_media":1255,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88],"tags":[63,89,90],"yoast_head":"\nSet Your Google Analytics Tracking ID As A Variable In Google Tag Manager - www.gregcruce.com<\/title>\n<meta name=\"description\" content=\"A great tip for an easy way to roll out Google Tag Manager and Google Analytics for live sites or in-development sites.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Set Your Google Analytics Tracking ID As A Variable In Google Tag Manager - www.gregcruce.com\" \/>\n<meta property=\"og:description\" content=\"A great tip for an easy way to roll out Google Tag Manager and Google Analytics for live sites or in-development sites.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/\" \/>\n<meta property=\"og:site_name\" content=\"www.gregcruce.com\" \/>\n<meta property=\"article:published_time\" content=\"2015-07-19T15:00:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-07-05T13:03:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.gregcruce.com\/wp-content\/uploads\/google-analytics-tracking-id-as-a-variable-in-google-tag-manager.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1540\" \/>\n\t<meta property=\"og:image:height\" content=\"598\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Greg Cruce\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/www.twitter.com\/gregcruce\/\" \/>\n<meta name=\"twitter:site\" content=\"@gregcruce\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Greg Cruce\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/\",\"url\":\"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/\",\"name\":\"Set Your Google Analytics Tracking ID As A Variable In Google Tag Manager - www.gregcruce.com\",\"isPartOf\":{\"@id\":\"https:\/\/www.gregcruce.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.gregcruce.com\/wp-content\/uploads\/google-analytics-tracking-id-as-a-variable-in-google-tag-manager.jpg\",\"datePublished\":\"2015-07-19T15:00:26+00:00\",\"dateModified\":\"2016-07-05T13:03:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.gregcruce.com\/#\/schema\/person\/f106cd91d8004063aab0536d0bb8865c\"},\"description\":\"A great tip for an easy way to roll out Google Tag Manager and Google Analytics for live sites or in-development sites.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/#primaryimage\",\"url\":\"https:\/\/www.gregcruce.com\/wp-content\/uploads\/google-analytics-tracking-id-as-a-variable-in-google-tag-manager.jpg\",\"contentUrl\":\"https:\/\/www.gregcruce.com\/wp-content\/uploads\/google-analytics-tracking-id-as-a-variable-in-google-tag-manager.jpg\",\"width\":1540,\"height\":598,\"caption\":\"Google Analytics Tracking ID As A Variable In Google Tag Manager\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.gregcruce.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Set Your Google Analytics Tracking ID As A Variable In Google Tag Manager\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.gregcruce.com\/#website\",\"url\":\"https:\/\/www.gregcruce.com\/\",\"name\":\"www.gregcruce.com\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.gregcruce.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.gregcruce.com\/#\/schema\/person\/f106cd91d8004063aab0536d0bb8865c\",\"name\":\"Greg Cruce\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gregcruce.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6be99f0190ebf09a94accef908c2f398?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6be99f0190ebf09a94accef908c2f398?s=96&d=mm&r=g\",\"caption\":\"Greg Cruce\"},\"description\":\"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.\",\"sameAs\":[\"https:\/\/www.gregcruce.com\",\"https:\/\/www.linkedin.com\/pub\/greg-cruce\/66\/240\/6b0\",\"https:\/\/x.com\/https:\/\/www.twitter.com\/gregcruce\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Set Your Google Analytics Tracking ID As A Variable In Google Tag Manager - www.gregcruce.com","description":"A great tip for an easy way to roll out Google Tag Manager and Google Analytics for live sites or in-development sites.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/","og_locale":"en_US","og_type":"article","og_title":"Set Your Google Analytics Tracking ID As A Variable In Google Tag Manager - www.gregcruce.com","og_description":"A great tip for an easy way to roll out Google Tag Manager and Google Analytics for live sites or in-development sites.","og_url":"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/","og_site_name":"www.gregcruce.com","article_published_time":"2015-07-19T15:00:26+00:00","article_modified_time":"2016-07-05T13:03:28+00:00","og_image":[{"width":1540,"height":598,"url":"https:\/\/www.gregcruce.com\/wp-content\/uploads\/google-analytics-tracking-id-as-a-variable-in-google-tag-manager.jpg","type":"image\/jpeg"}],"author":"Greg Cruce","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/www.twitter.com\/gregcruce\/","twitter_site":"@gregcruce","twitter_misc":{"Written by":"Greg Cruce","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/","url":"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/","name":"Set Your Google Analytics Tracking ID As A Variable In Google Tag Manager - www.gregcruce.com","isPartOf":{"@id":"https:\/\/www.gregcruce.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/#primaryimage"},"image":{"@id":"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/#primaryimage"},"thumbnailUrl":"https:\/\/www.gregcruce.com\/wp-content\/uploads\/google-analytics-tracking-id-as-a-variable-in-google-tag-manager.jpg","datePublished":"2015-07-19T15:00:26+00:00","dateModified":"2016-07-05T13:03:28+00:00","author":{"@id":"https:\/\/www.gregcruce.com\/#\/schema\/person\/f106cd91d8004063aab0536d0bb8865c"},"description":"A great tip for an easy way to roll out Google Tag Manager and Google Analytics for live sites or in-development sites.","breadcrumb":{"@id":"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/#primaryimage","url":"https:\/\/www.gregcruce.com\/wp-content\/uploads\/google-analytics-tracking-id-as-a-variable-in-google-tag-manager.jpg","contentUrl":"https:\/\/www.gregcruce.com\/wp-content\/uploads\/google-analytics-tracking-id-as-a-variable-in-google-tag-manager.jpg","width":1540,"height":598,"caption":"Google Analytics Tracking ID As A Variable In Google Tag Manager"},{"@type":"BreadcrumbList","@id":"https:\/\/www.gregcruce.com\/set-your-google-analytics-tracking-id-as-a-variable-in-google-tag-manager\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.gregcruce.com\/"},{"@type":"ListItem","position":2,"name":"Set Your Google Analytics Tracking ID As A Variable In Google Tag Manager"}]},{"@type":"WebSite","@id":"https:\/\/www.gregcruce.com\/#website","url":"https:\/\/www.gregcruce.com\/","name":"www.gregcruce.com","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.gregcruce.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.gregcruce.com\/#\/schema\/person\/f106cd91d8004063aab0536d0bb8865c","name":"Greg Cruce","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gregcruce.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6be99f0190ebf09a94accef908c2f398?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6be99f0190ebf09a94accef908c2f398?s=96&d=mm&r=g","caption":"Greg Cruce"},"description":"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.","sameAs":["https:\/\/www.gregcruce.com","https:\/\/www.linkedin.com\/pub\/greg-cruce\/66\/240\/6b0","https:\/\/x.com\/https:\/\/www.twitter.com\/gregcruce\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.gregcruce.com\/wp-json\/wp\/v2\/posts\/1249"}],"collection":[{"href":"https:\/\/www.gregcruce.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gregcruce.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gregcruce.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gregcruce.com\/wp-json\/wp\/v2\/comments?post=1249"}],"version-history":[{"count":0,"href":"https:\/\/www.gregcruce.com\/wp-json\/wp\/v2\/posts\/1249\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gregcruce.com\/wp-json\/wp\/v2\/media\/1255"}],"wp:attachment":[{"href":"https:\/\/www.gregcruce.com\/wp-json\/wp\/v2\/media?parent=1249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gregcruce.com\/wp-json\/wp\/v2\/categories?post=1249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gregcruce.com\/wp-json\/wp\/v2\/tags?post=1249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}