How to Set Up Tracking in Google Tag Manager (GTM)

This guide will help you set up tracking so activity inside your showroom is properly recorded in Google Analytics 4 (GA4).

You only need to do this once.


Step 1: Create Variables (Tell GTM What Information to Capture)

Variables are pieces of information we want to track (for example: product name, page title, search term, etc.).

In Google Tag Manager:

  1. Go to Variables
  2. Under “User-Defined Variables” click New
  3. Choose Data Layer Variable
  4. Enter the variable name exactly as listed below
  5. Click Save

Create these one by one:

Variable Name Data Layer Variable Name
DLV - Page Path pagePath     
DLV - Page Title pageTitle     
DLV - Product ID productId     
DLV - Product Name productName     
DLV - Modal Name modalName     
DLV - Modal Type modalType     
DLV - Page Number pageNumber     
DLV - Breadcrumb Group breadcrumbGroup     
DLV - Hotspot ID hotspotId     
DLV - Hotspot Type hotspotType     
DLV - Content ID contentId     
DLV - Content Type contentType     
DLV - Interaction Type interactionType     
DLV - Search Term searchTerm     
DLV - Results Count resultsCount     
DLV - Form Name formName     

Once done, move to the next step.


Step 2: Create Event Triggers (Tell GTM When to Track Something)

Triggers tell GTM when to send data.

In GTM:

  1. Go to Triggers
  2. Click New
  3. Choose Custom Event
  4. Enter the Event Name exactly as written below
  5. Click Save

Create these triggers:

  • virtualPageview     
  • productView     
  • modalOpen     
  • paginationChange     
  • hotspotClick     
  • contentView     
  • 3dInteraction     
  • search     
  • formSubmit     

The event names must match exactly (including capital letters).


Step 3: Create GA4 Event Tags (Send the Data to Google Analytics)

Now we connect everything to Google Analytics 4.

For each trigger above, create a matching GA4 Event Tag.

Example 1: Virtual Page View

  1. Go to Tags
  2. Click New
  3. Choose Google Analytics: GA4 Event
  4. Enter your GA4 Measurement ID (looks like: G-XXXXXXXXXX)
  5. Event Name: page_view     

Under Event Parameters add:

  • page_path      → {{DLV - Page Path}}
  • page_title      → {{DLV - Page Title}}

Trigger: select virtualPageview


Click Save


Example 2: Product View

Create a new GA4 Event tag:

Event Name: view_item     

Event Parameters:

  • item_id      → {{DLV - Product ID}}
  • item_name      → {{DLV - Product Name}}

Trigger: productView

Save.


Example 3: Hotspot Click

Create a GA4 Event tag:

Event Name: hotspot_interaction     

Event Parameters:

  • hotspot_id      → {{DLV - Hotspot ID}}
  • hotspot_type      → {{DLV - Hotspot Type}}

Trigger: hotspotClick

Save.


Repeat this same pattern for:

  • modalOpen     
  • contentView     
  • 3dInteraction     
  • paginationChange     
  • search     
  • formSubmit     

Each event should:

  • Use a GA4 Event tag
  • Match the trigger name
  • Include the relevant variables



Step 4: Test Everything Before Publishing

Before going live:

  1. Click Preview (top right in GTM)
  2. Enter your showroom website URL
  3. Navigate through the showroom
  4. Check that events appear in the GTM debug panel
  5. Also check Google Analytics → Realtime Report to confirm events are being received

If events appear correctly, you're ready to publish.


Step 5: Publish

  1. Click Submit
  2. Add a Version Name

    Example:

    “Virtual Showroom – Initial Tracking Setup”

  3. Click Publish

Step 6: Create Additional Variables

We need to tell GTM about some new pieces of information related to:

  • Panorama changes
  • Product selector interactions
  • Grid menu opens

In Google Tag Manager:

  1. Go to Variables
  2. Under User-Defined Variables, click New
  3. Choose Data Layer Variable
  4. Enter the name exactly as shown below
  5. Click Save

Create these 10 new variables:

Variable Name Data Layer Variable Name
DLV - Panorama ID panoramaId   
DLV - Panorama Name panoramaName   
DLV - Selector ID selectorId   
DLV - Selector Title selectorTitle   
DLV - Thumbnail Index thumbnailIndex   
DLV - Thumbnail Name thumbnailName   
DLV - Filters filters   
DLV - Filter Type filterType   
DLV - Template template   
DLV - Menu ID menuId   

Once these are saved, move to the next step.


Step 7: Create New Custom Event Triggers

Some of these events use existing triggers, but a few new ones are required.

In GTM:

  1. Go to Triggers
  2. Click New
  3. Choose Custom Event
  4. Enter the event name exactly as written
  5. Click Save

Create these new triggers:

  • productSelectorChange   
  • productSelectorThumbnailClick   
  • productSelectorOpen   
  • gridMenuOpen   

Make sure the names match exactly (capital letters matter).

You already have the 3dInteraction trigger from the previous setup - we’ll reuse that.


Step 8: Create or Update GA4 Event Tags

Now we connect everything to Google Analytics 4.


Panorama Change Event

Use your existing trigger: 3dInteraction

Create a new GA4 Event tag:

Event Name:

panorama_change   

Event Parameters:

  • panorama_id    → {{DLV - Panorama ID}}
  • panorama_name    → {{DLV - Panorama Name}}
  • interaction_type    → {{DLV - Interaction Type}}

Trigger: 3dInteraction

Save.


Product Selector Change

Create a new GA4 Event tag:

Event Name:

product_selector_change   

Event Parameters:

  • selector_id    → {{DLV - Selector ID}}
  • selector_title    → {{DLV - Selector Title}}
  • thumbnail_index    → {{DLV - Thumbnail Index}}
  • thumbnail_name    → {{DLV - Thumbnail Name}}

Trigger: productSelectorChange

Save.


Product Selector Thumbnail Click

Create another GA4 Event tag:

Event Name:

product_selector_thumbnail_click   

Event Parameters:

  • selector_id    → {{DLV - Selector ID}}
  • selector_title    → {{DLV - Selector Title}}
  • thumbnail_index    → {{DLV - Thumbnail Index}}
  • thumbnail_name    → {{DLV - Thumbnail Name}}

Trigger: productSelectorThumbnailClick

Save.


Product Selector Open

Create a GA4 Event tag:

Event Name:

product_selector_open   

Event Parameters:

  • selector_id    → {{DLV - Selector ID}}
  • selector_title    → {{DLV - Selector Title}}

Trigger: productSelectorOpen

Save.


Grid Menu Open

Create a GA4 Event tag:

Event Name:

grid_menu_open   

Event Parameters:

  • template    → {{DLV - Template}}
  • menu_id    → {{DLV - Menu ID}}

Trigger: gridMenuOpen

Save.


Final Step: Test Before Publishing

As before:

  1. Click Preview

    Enter your showroom URL

    Interact with:

    • Panorama switching
    • Product selector
    • Thumbnail clicks
    • Grid menu open

      Confirm events appear in:

    • GTM Debug panel
    • Google Analytics → Realtime

You should now see:

  • panorama_change
  • product_selector_change
  • product_selector_thumbnail_click
  • product_selector_open
  • grid_menu_open

Publish

If everything looks correct:

  1. Click Submit
  2. Add a version name

    Example:

    “Virtual Showroom – Panorama & Selector Tracking”

  3. Click Publish
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.