Google Tag Manager Lookup Table Regular Expression


Google Tag Manager (GTM) Lookup Table is a built-in feature that allows you to map one set of values to another using regular expressions. This can be useful for situations where you want to simplify complex data, standardize data, or map data from one format to another.

Here are the steps to set up a Lookup Table using regular expressions in Google Tag Manager:

  1. In GTM, go to the Variables tab and create a new variable of the type Lookup Table.
  2. In the Lookup Table variable, create a new row for each mapping you want to make.
  3. In the Input column, enter the regular expression that will match the original value.
  4. In the Output column, enter the value that you want to map to the original value.
  5. In the Triggers or Tag, set the variable you want to map as the Input variable, and the Lookup Table variable as the output variable.
  6. Publish the container.

Regular expressions are a powerful tool that allows you to match complex patterns of characters in a string, making it possible to use GTM Lookup Table for a wide range of use cases.

^product– matches any string that starts with “product-“
[0-9]{3} matches any 3 digits
^(?!.*error).*$ matches any string that doesn’t contain the word “error”

It is important to note that you need to have a good understanding of regular expressions and their syntax to be able to use them effectively in GTM Lookup Table.

Also, it’s recommended to test the regular expressions before using them in production to ensure they are working as expected.

Using Regex (Regular Expressions) Lookup Google Tag Manager

RegEx Lookup Table Variable In Google Tag Manager

Warning: If you do n’t know about javascript or do n’t have developing knowledge then do n’t try to Google Tag Manager Lookup Table Regular Expression without Plugin that can broke your site, Cart and other functionality 

Disclaimer: Google tag manager belongs to Google property 

For Contact:

I am available for Hire on Freelancer:

I am available for Hire on Upwork:

I am available for Hire on Peopleperhour:

I am available for Hire on Guru:

Leave a Reply

Your email address will not be published. Required fields are marked *