Search for the Article

Lookup Table : Using lookup table track social media clicks from website in Google analytics

lookup table

Lookup table variable is a user defined variable in Google Tag Manager. A Lookup Table is a feature that allows you to map a set of input values to corresponding output values, based on specified rules.

What is Lookup table

In Google Tag Manager, a Lookup Table is a feature that allows you to map a set of input values to corresponding output values, based on specified rules. This can be useful for performing dynamic data manipulation and data mapping for tags, triggers and variables in Google Tag Manager. Some common use cases for Lookup Tables include:

Examples of lookup table Uses

Below are just a few use cases, where we can use cases for Lookup Tables in Google Tag Manager, depending on the needs of your website and analytics implementation.

  • Mapping country codes to country names: You can map ISO country codes to the full country name, so that you can display the country name in your analytics reports rather than just the code.
  • Mapping UTM parameters to analytics dimensions: You can use Lookup Tables to map UTM parameters to analytics dimensions, such as mapping "source" to "Campaign Source".
  • Mapping categories to products: You can map product categories to product names, so that you can analyze your e-commerce data at the category level in your analytics reports.
  • Mapping URL paths to page titles: You can use Lookup Tables to map URL paths to page titles, so that you can display the page title in your analytics reports rather than just the URL.
  • Mapping user IDs to user segments: You can use Lookup Tables to map user IDs to user segments, such as "registered user" or "guest user", so that you can analyze your data by user segment in your analytics reports.

Track Social Media Clicks from Website in Google Analytics

Yes, you can track social media clicks using a Lookup Table in Google Tag Manager. Here's how you can set this up:

1. In GTM, go to Variables > New > Lookup table and enter the following settings:



2. Go to trigger , Choose trigger type -> Just links  --> Some link clicks --> Choose your lookup table that you have created and set its value to does not equal to undefined.  




3. Create tag --> Select universal analytics- and enter the following settings




then assign your trigger to it, 


All done, Publish your implementation !