Setting up conversion tracking
Marketing page tags, checkout data, and server-side purchase events
This guide explains how to set up conversion tracking for the booking funnel. Both required marketing page scripts will be provided.
1. Install the marketing page tags
Two tags are required on the marketing or landing site to connect users to the booking funnel:
- Base tag — loads on every page and initializes tracking for the booking funnel.
- Product Viewed tag — loads only on pages where the show is featured, such as the homepage or show detail pages. It should not load on utility pages such as FAQs or Terms.
Tag implementation
The Base tag must load before the Product Viewed tag fires.
- In GTM, add both scripts as Custom HTML tags. Trigger the Base tag on All Pages and the Product Viewed tag only on pages where the show is featured. Set the Base tag's trigger priority so it fires first.
- For direct implementation, add the Base tag to the global template or header so it loads on every page. Add the Product Viewed tag only to templates for pages where the show is featured.
2. Access checkout and purchase data in GTM
A GTM container ID is required. Once provided, the container will load on the checkout order confirmation page.
Trigger the purchase tag
Trigger the purchase tag on a History Change event where Page Path contains:
/checkout/order-confirmationCheckout data is written to session storage when the user reaches the order confirmation page.
Create variables for checkout data
The checkout data is not available in the GTM Data Layer. Use a Custom JavaScript Variable to read each required field from session storage.
- In GTM, create a new variable.
- Select Custom JavaScript.
- Use the following template, replacing
totalwith the required field:
function() {
var data = sessionStorage.getItem('checkout details');
return data ? JSON.parse(data).total : undefined;
}Available checkout data
Checkout data is stored in the browser's session storage under the key checkout details.
| Key | Description | Type |
|---|---|---|
bookingReference | Booking reference | String |
currency | Transaction currency | String |
email | Customer email | String |
paymentId | Internal payment reference | String |
total | Total order value | Number |
3. Recommended purchase tracking: server-side events
For Google Ads, Meta, and TikTok, send purchase events server-side through each platform's conversion API rather than using GTM to send purchase events directly to the ad platforms.
Client-side tags can be blocked by ad blockers and browser tracking restrictions. Server-side events provide a more reliable record of completed purchases.
Required access
| Platform | Required access |
|---|---|
| Meta | Pixel ID and permission for Segment to send events as an external platform in Meta Events Manager |
| TikTok | Pixel ID and Events API access token |
| Google Ads | Grant Standard account access to [email protected] |
Implementation recommendation
Use the server-side purchase event as the single source of purchase conversions for each platform. Do not also send purchase events from GTM for the same conversion.
Updated 12 days ago