Digital Insights

  • Analytics
    • Google Analytics
    • Adobe Analytics
    • Calculated Metrics
  • Digital Marketing
    • SEO
    • PPC
  • Tag Manager
    • GTM
    • DTM
  • About Me
Home » Tag Manager » How to use a “Lookup Table” Macro for different Google Analytic Properties

How to use a “Lookup Table” Macro for different Google Analytic Properties

January 28, 2016 by YiannisG

The “Lookup table” macro is the ideal macro if you have installed one container across your domain and multiple sub-domains with each one having its own Google analytic property.

According to Google a Lookup Table macro “allows you to create a macro for which the value varies according to the value in another macro. This is useful if your website is set up in such a way that the appropriate value (for example, a conversion tracking ID) can be mapped to the URL or another aspect of the page. In this example, a macro named Conversion ID is being created. If the URL is “/thanks/buy1.html”, the value is set to “12345”; if the URL is “thanks/buy2.html”, the value is set to “34567”. There is no limit to the number of rows in the lookup table“.

This is very common within large organisations where different product owners set different profiles only relevant to what they are assigned to do (for example your development team having their own exclusive environment or your content team running the blog of the site on a subdomain) or even to small businesses with multiple subdomains such as blog.yourwebsite.com or product.yourwebsite.com.

Instead of creating different constant string macros for each property separately (as shown in our previous article here) you can use one lookup table macro for all your google analytic properties.

Here is a detailed explanation in how to do this:

Go to your Google tag manager interface and select “New Macro” and under the macro type, select “Lookup table”.

lookup Table Macro

Then click on the {not set} icon and select {{url hostname}} as shown below

URL-Hostname-2

Name your macro something you will remember such as “GApropertyIDs” and then collect all your URL and the Google analytic property ID assigned to them in your Google analytics account. Please make sure that you have the exact URLs of all your domains as any mispell or variation will prevent the tag to fire.

On the first column start adding the domains and subdomains you wish to track (in our example lets assume the web site URL, the blog subdomain and the development subdomain0 and on the second column assign the relevant Google analytics profile id.

GApropertyids-3
Once you are done and have listed all your properties, save the macro and go back to your Google Analytic Universal tag and use your new macro in the Tracking ID field.

Save the tag and that’s it. You now have three different Google analytic properties populated separately with the use of one tag.

Related posts:

  1. How to track Outlook email leads and Mobile calls with Google Tag Manager
  2. How to Install Google Analytics Universal with Google Tag Manager

Filed Under: GTM, Tag Manager Tagged With: GTM

About YiannisG

Yiannis has twelve years experience working in digital marketing and was an early enthusiast and adopter of web analytics. He is currently working as a senior digital analyst and has held different positions at various companies such as Tesco, Gain Capital, City Index, Art Division, Middlesex University, Ford, Honda to name a few. He has also worked as a consultant for various private firms and digital agencies, primarily for web analytics and biddable media set up & optimisation. In his spare time he is working on various SEO projects - but in reality he is trying to outwit Google.

Free updates & EBooks

Recent Posts

  • Element Visibility trigger in Google Tag Manager
  • Monitoring your KPIs performance with Adobe Workspace Functions
  • Real Estate Dynamic Remarketing, A setup guide
  • Google Analytics Implementation Guide for Beginners
  • How to measure your YouTube video length performance

Categories

  • Adobe Analytics (4)
  • Calculated Metrics (4)
  • Digital Insights (11)
  • Digital Marketing (3)
  • DTM (4)
  • Google Analytics (6)
  • GTM (4)
  • PPC (2)
  • SEO (1)
  • Tag Manager (8)

Categories

Adobe Analytics Calculated Metrics Digital Insights Digital Marketing DTM Google Analytics GTM PPC SEO Tag Manager

Copyright © 2023 · News Pro Theme on Genesis Framework · WordPress · Log in