All Posts

How to use Google Tag Manager with the embedded checkout widget

(Last Updated 4/17/25)

When using the PromoTix embedded checkout widget, the ticket buying process is embedded on your own website inside of an iFrame.

This guide explains how you can capture dynamic purchase events triggered inside the PromoTix embedded checkout widget and send them to Google Tag Manager installed on your own website.

By following these instructions, you can pass real purchase data (such as order amount, transaction ID, currency, etc.) to third-party platforms such as Meta, Google Ads, The Trade Desk, and more.

1.  Install Google Tag Manager on your website

Add your Google Tag Manager container on the domain where your PromoTix embedded checkout widget is located.

Verify that it is working by opening the website in GTM Preview Mode.

2. Create a custom HTML tag to listen for messages

Inside your parent Google Tag Manager container, create a new custom HTML tag:

  • Tag name 👉 cHTML Order Success - Listener
  • Tag type 👉 Custom HTML
  • Trigger 👉 All Pages
  • Tag code 👇

<script>

  window.addEventListener("message", function (event) {

    if (event.data && event.data.event === "order_success") {

      window.dataLayer = window.dataLayer || [];

      window.dataLayer.push({

        event: "order_success",

        transaction_id: event.data.transaction_id,

        revenue: event.data.revenue,

        currency: event.data.currency

      });

    }

  });

</script>

 

This tag listens for the postMessage sent from the PromoTix embedded checkout widget iFrame and pushes a clean event into the parent dataLayer:

GTM Custom HTML Tag

3. Create a trigger for order_success event

Create a custom event trigger that will fire any tag when the order_success is pushed by the listener:

  • Trigger name 👉 CE - order_success
  • Trigger type 👉 Custom Event
  • Event name 👉 order_success

order_success trigger

4.  Connect your third-party tag

Create a third-party tracking tag (Meta, Google Ads, The Trade Desk, etc.) and use the trigger you created in step 3.

  • Tag example 👉 custom image tag for The Trade Desk
  • Set trigger 👉 CE - order_success

5. Create Data Layer Variables

Create the following Data Layer Variables in Google Tag Manager to pass dynamic values into your third-party tags:


Variable Name

Data Layer Variable Name

dlv_transaction_id

transaction_id

dlv_revenue

revenue

dlv_currency

currency

 

  • Go to Variables 👉 New
  • Type 👉 Data Layer Variable
  • Use the exact names shown above

Create Data Layer Variables_1

Create Data Layer Variables_2

Still Have Questions?

Contact Us

Sam Burns
Sam Burns
Sam is the Client Success and Ambassador Program Specialist for PromoTix, Inc.

Related Posts

How to use Google Tag Manager with the embedded checkout widget

(Last Updated 4/17/25) When using the PromoTix embedded checkout widget, the ticket buying process is embedded on your own website inside of an iFrame. This guide explains how you can capture dynamic purchase events triggered inside the PromoTix embedded checkout widget and send them to Google Tag Manager installed on your own website. By following these instructions, you can pass real purchase data (such as order amount, transaction ID, currency, etc.) to third-party platforms such as Meta, Google Ads, The Trade Desk, and more.

  • 9 min read
  • Apr 17, 2025 4:06:19 PM

How to create a shared inventory

(Last Updated 7/17/24)

  • 4 min read
  • Jul 20, 2024 3:31:23 AM

How to edit customer details

(Last Updated 5/1/24)

  • 3 min read
  • May 2, 2024 9:27:20 AM