Lesson 10 of 15
Lookup Table Variable
① Connect your GTM container
Paste your container ID to load it into this page. It only ever runs here.
Advanced: use a specific environment
Often you want a clean label instead of a raw value. A path like /pricing is fine for a developer, but in reports you would rather see commercial. A Lookup Table variable does exactly that: you give it an input, and it returns a different output for each value you list.
It is the no-code way to translate one set of values into another, page paths into content categories, country codes into regions, product IDs into names, without writing any JavaScript.
Goal
Build a Lookup Table variable that maps each Page Path to its content category.
Build it in GTM
Create the Lookup Table variable
Go to Variables → New and choose Lookup Table.Set the input variable
Set Input Variable to{{Page Path}}(enable the built-in Page Path variable under Variables → Configure if it is not in the list).Add the mapping rows
Add three rows under Lookup Table:/hometohomepage,/pricingtocommercial, and/blogtocontent. The left column is the input value, the right is what the variable returns.Name it and save
Optionally set a Default Value for unlisted paths, then name itLT - page categoryand Save. No tag is required, the variable is the deliverable.
Debug in Tag Assistant
Copy this lesson's live URL and paste it into GTM Preview, that is the page Tag Assistant connects to. It has the clickable elements, so this page stays clean for reading.
- In your GTM, click Preview.
- Paste the live URL above and click Connect.
- Interact with the live page and watch your tag fire in Tag Assistant.
What you should expect to see
{{LT - page category}} in Tag Assistant's Variables tab: it resolves to homepage on /home, commercial on /pricing and content on /blog.Verify your container
Built it? Export your container, Admin → Export Container, choose your workspace, then drop the JSON here to check it against this lesson.
Drop your container .json here
or browse · checked in your browser, nothing is uploaded