Lookup Table Variable in Google Tag Manager (GTM)

Tony Villanova - September 3, 2020

GTM has many pre-built variables off the shelf. You even have the option to create/ customize your own variables known as a User-Defined Variable in GTM. One of the User-Defined Variables I find very helpful is the Lookup Table variable under the Utilities section of the User-Defined Variables.

This variable works just as its title describes. You can have an input and tell GTM what you would like the output to be.

Example: Lets say you have many buttons on your homepage and although they each do different things and have different click classes or click ID’s, it can be difficult to differentiate what the click classes are when a user is in the Google Analytics Reporting. This is where the Lookup Table can come in handy and help streamline your data and reporting even further. In our example we have 4 buttons that each link to a different area on our site. Our wonderful in-house developers made sure that each has a separate Click Class however in our reporting we would like to see the area of the website that the user clicked on instead of the Click Class.

Within the Variable configuration we need to select the Input Variable that we will be referencing in this table which is {{Click Classes}}.

Next, we need to enter each of the Click Classes for the different Buttons we are wanting to change the output of.

Once the Input values have been entered, we can then enter in what the output of the click classes will be. (The output is the verbiage we would like to see in our reporting.)

Once we have completed the table and saved the Variable, we can then use this variable (which is the lookup table we just created) in our Event Tag so that the output of the click class will now show the area the user clicked on rather than the button class that was previously there.

The Lookup Table Variable is a great workaround for getting your reporting to display exactly what you want to see and you can do it all without needing to bother your developers which will save you both time!

© 2024 MoreVisibility. All rights reserved.