Don't have one? Create one ↗
← All courses

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

  1. Create the Lookup Table variable

    Go to Variables → New and choose Lookup Table.
  2. 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).
  3. Add the mapping rows

    Add three rows under Lookup Table: /home to homepage, /pricing to commercial, and /blog to content. The left column is the input value, the right is what the variable returns.
  4. Name it and save

    Optionally set a Default Value for unlisted paths, then name it LT - page category and 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.

  1. In your GTM, click Preview.
  2. Paste the live URL above and click Connect.
  3. Interact with the live page and watch your tag fire in Tag Assistant.

What you should expect to see

Navigate between the paths and watch {{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

0 of 15 lessons complete