Skip to main content

Using Your Own Google Tag Manager Container

How to use your own GTM container on your storefront and embedded widgets, with a full reference of all dataLayer events and an importable GTM template.

Updated over a week ago

If you need full control over your tracking setup, you can replace Understory's default Google Tag Manager (GTM) container with your own. This lets you configure exactly which tags fire on your storefront — including Google Analytics 4, Google Ads, Meta Pixel, and any other tags you need.

This is an advanced option. When you enable your own GTM container, Understory's built-in tracking integrations for GA4, Google Ads, and Meta Pixel are disabled. You take over responsibility for configuring those tags yourself inside your GTM container.


How to Enable Your Own GTM Container

Requirements: Admin access and an existing Google Tag Manager account.

  1. Go to Growth > Tracking — in the left-hand menu of your Backoffice

  2. Find the Google Tag Manager section — it's listed alongside GA4, Google Ads, and Meta Pixel

  3. Enter your Container ID — in the format GTM-XXXXXXX (find this in your GTM account under Admin > Container Settings)

  4. Toggle the switch to Active — and click Save

Once saved, your GTM container loads on your storefront instead of Understory's default container.


What Changes When You Use Your Own Container

Replaced:

  • Understory's default GTM container is fully replaced by yours — only one container loads at a time

  • The individual GA4, Google Ads, and Meta Pixel integrations in the Tracking page are disabled automatically. You cannot enable them alongside your own GTM container

Still works:

  • Your storefront continues to push all tracking events to the dataLayer — your GTM container picks these up automatically

  • UTM campaign parameters are still captured and preserved

  • Understory's internal analytics (used for your dashboard metrics) continue to work independently

You are now responsible for:

  • Creating and configuring all tags in your GTM container (GA4, Google Ads, Meta Pixel, etc.)

  • Setting up cookie consent mode

  • Configuring conversion tracking

  • Testing that your tags fire correctly


Quick Start with GTM Templates

We provide importable GTM container templates with pre-configured tags, triggers, and variables. Choose the template that matches your setup:

  • Download Storefront template — for customers who use their own GTM container on the Understory storefront

  • Download Widget template — for customers who embed the Understory booking or gift card widget on their own website and want to track widget interactions

You can import both if you use the storefront and widgets together — the shared variables and Google Tag configuration have the same names, so GTM merges them automatically.

What's included

Each template imports an Understory folder into your GTM container. Everything is prefixed with "Understory - " so you can easily identify imported items alongside your own tags.

Storefront template:

Type

What's included

Tags

Google Tag (GA4 config), GA4 Event tags for select_item, view_item, add_to_cart, view_cart, begin_checkout, purchase, Conversion Linker

Triggers

Custom event triggers for all storefront events including on_receipt and private_request_submitted

Variables

Data Layer variables for ecommerce data, receipt payload, and a placeholder GA4 Measurement ID

Widget template:

Type

What's included

Tags

Google Tag (GA4 config), GA4 Event tags for view_item, add_to_cart, begin_checkout, Conversion Linker

Triggers

Custom event triggers for understory_view_item, understory_add_to_cart, understory_begin_checkout

Variables

Data Layer variables for ecommerce data and a placeholder GA4 Measurement ID

How to import

  1. Download the template — use the links above to save the JSON file to your computer

  2. Open your GTM container — go to Admin > Import Container

  3. Choose the file — select the downloaded JSON file

  4. Select "Merge" — choose "Rename conflicting tags, triggers, and variables" to safely add the Understory items alongside your existing setup

  5. Review and confirm — GTM shows a summary of what will be added

After importing

  1. Open the variable "Understory - GA4 Measurement ID" — replace G-XXXXXXXXXX with your actual GA4 Measurement ID

  2. Preview and test — use GTM's Preview mode to verify events fire correctly

  3. Publish — when everything looks good, publish your container


Storefront DataLayer Events

Your storefront pushes the following events to the dataLayer. These follow the standard GA4 ecommerce schema.

Page Views

page_view — Fires on every page navigation.

Browsing Events

select_item — A visitor clicks on an experience in your storefront listing.

Property

Example Value

item_list_id

companyProfile

item_list_name

Company Profile

items[].item_id

Experience ID

items[].item_name

Experience name

items[].affiliation

Understory

items[].item_category

experience

view_item — A visitor opens an experience detail page.

Property

Example Value

currency

EUR

value

Total price

items[].item_id

Experience ID

items[].item_name

Experience name

items[].affiliation

Understory

items[].item_category

experience

Booking Flow Events

add_to_cart — A visitor selects guests and proceeds in the booking flow.

Property

Example Value

currency

EUR

totalPrice

Total price

items[].item_id

Experience ID

items[].item_name

Experience or variant name

items[].affiliation

Understory

items[].item_category

experience, addon, or voucher

items[].item_variant

Variant ID

items[].price

Unit price

items[].quantity

Number of guests

view_cart — The cart page is viewed.

Property

Example Value

currency

EUR

value

Cart total

items[]

Same structure as add_to_cart

begin_checkout — A visitor starts the payment process.

Property

Example Value

currency

EUR

value

Checkout total

items[].item_id

Experience or variant ID

items[].item_name

Experience name (or Voucher for gift cards)

items[].affiliation

Understory

items[].item_category

variant/experience, addon, or voucher

items[].price

Unit price

items[].quantity

Number of guests

Purchase Event

on_receipt — A purchase is completed. This is the most important event for conversion tracking.

Important: This event is named on_receipt, not the standard GA4 purchase. The GTM template handles this mapping for you — the included "Understory - GA4 Event - purchase" tag listens for on_receipt and sends it to GA4 as a purchase event. If you're setting this up manually, create a custom event trigger for on_receipt.

Property

Example Value

transaction_id

Unique receipt ID (use this for conversion deduplication)

payload.receiptId

Receipt ID

payload.currency

EUR

payload.value

Order total (excluding gift card payments)

payload.items[].item_id

Variant ID (or voucher ID for gift cards)

payload.items[].item_name

Item name

payload.items[].affiliation

Understory

payload.items[].item_category

variant/experience or voucher

payload.items[].item_category_2

Item name

payload.items[].item_category_3

Experience ID

payload.items[].price

Unit price (VAT inclusive)

payload.items[].quantity

Quantity

payload.items[].currency

EUR

payload.items[].vat_rate

VAT rate (e.g. 0.25)

payload.items[].vat_amount

VAT amount

Other Events

private_request_submitted — A visitor submits a private event request form.

Property

Example Value

formattedDate

Requested date

participants

Number of participants


Embedded Widget DataLayer Events

If you use the Understory booking or gift card widget on your own website, the widgets also push ecommerce events to the dataLayer. These events are prefixed with understory_ to avoid interfering with any existing tracking you have on your site.

The widget events use the same item data structure as the storefront events (currency, value, items with item_id, item_name, affiliation, etc.), so you can process them in the same way.

Important: The widgets do not load GTM — they only push events to the dataLayer. If you have GTM installed on your website, these events are picked up automatically. If you don't have GTM, the events are safely ignored.

Booking Widget Events

understory_view_item — The widget loads and displays an experience.

Property

Example Value

currency

EUR

value

0

items[].item_id

Experience ID

items[].item_name

Experience name

items[].affiliation

Understory

items[].item_category

experience

understory_add_to_cart — A visitor selects guests and proceeds to the confirmation step.

Property

Example Value

currency

EUR

value

Total price

items[].item_id

Experience ID

items[].item_name

Experience and variant name

items[].affiliation

Understory

items[].item_category

experience or addon

items[].item_variant

Variant ID

items[].price

Unit price

items[].quantity

Number of guests

understory_begin_checkout — A visitor confirms their booking and proceeds to payment.

Property

Example Value

currency

EUR

value

Checkout total

items[].item_id

Experience ID

items[].item_name

Experience and variant name

items[].affiliation

Understory

items[].item_category

experience or addon

items[].item_variant

Variant ID

items[].price

Unit price

items[].quantity

Number of guests

Gift Card Widget Events

understory_view_item — The gift card widget loads.

Property

Example Value

currency

EUR

value

0

items[].item_id

gift-card (or experience ID for experience gift cards)

items[].item_name

Gift Card (or experience name)

items[].affiliation

Understory

items[].item_category

voucher

understory_begin_checkout — A visitor proceeds to payment for a gift card.

Property

Example Value

currency

EUR

value

Gift card amount

items[].item_id

gift-card (or experience ID)

items[].item_name

Gift Card (or experience name)

items[].affiliation

Understory

items[].item_category

voucher

items[].price

Gift card amount

items[].quantity

1

Using widget events in GTM

The understory_ prefix means these events won't accidentally trigger tags you've set up for other products on your site. The widget GTM template includes triggers that listen for the prefixed event names and forward them to GA4 as standard ecommerce events (view_item, add_to_cart, begin_checkout).


DataLayer Variables

These variables are pushed to the dataLayer before your GTM container loads on the storefront, so they're available to all your tags:

Variable

Description

company_id

Your Understory company ID

measurement_id

Your GA4 Measurement ID (if configured)

conversionLinkerDomains

Domains for cross-domain tracking (includes your storefront domain automatically)


Tips for Setting Up Conversion Tracking

Google Ads Conversions

  1. Create a Google Ads Conversion Tracking tag in your GTM container

  2. Set the trigger to fire on the on_receipt event

  3. Use the transaction_id property as the Order ID — this prevents duplicate conversions from being counted

  4. Map payload.value to the conversion value and payload.currency to the currency

Google Analytics 4

If you're using the Understory GTM templates, GA4 is already configured — just replace the Measurement ID placeholder. If you're setting up manually:

  1. Create a Google Tag using your Measurement ID

  2. Add GA4 Event tags for each ecommerce event you want to track

  3. Create Data Layer variables to extract the event properties (currency, value, items) and map them as event parameters

Meta Pixel

  1. Add the Meta Pixel base tag to your container

  2. Map the storefront events to Meta standard events — for example, on_receiptPurchase, begin_checkoutInitiateCheckout, view_itemViewContent


Cookie Consent

When you use your own GTM container, you manage consent mode. The storefront reads consent status from the dataLayer, so if you implement Google Consent Mode v2 in your container, it will be respected across all tracking.


Did this answer your question? If not, please reach out to us in the chat window at the bottom to the right, and we'll be happy to help 🤗

Did this answer your question?