Google Analytics 4 for third-party tracking

Google Analytics 4 for third-party tracking

Google Analytics 4 & Third-Party Tracking

⏱ Estimated time: 15 minutes

👤 Role: Marketing Managers, SEO/Web Agencies, Data Analysts


What you'll learn:

  • How to integrate your Google Tag Manager (GTM) container with the platform.

  • The specific Custom Event names required to track the guest booking journey.

  • How to capture transaction data using Data Layer Variables for precise ROI reporting.


When should I use this?

Use this guide if your marketing team or external agency requires bespoke tracking for third-party platforms such as Google Ads, Meta (Facebook) Pixel, or TikTok. This setup allows you to track exactly where a guest drops off in the funnel and calculate the exact return on ad spend (ROAS).

Key Logic:

While the platform offers standard GA4 tracking, third-party pixels require a Google Tag Manager container to act as a middleman. By mapping our platform's internal "Events" to your GTM triggers, you can fire specific tags when a guest adds a room to their basket or completes a purchase.


Before you start:

  • Ensure you have administrative access to your Google Tag Manager account.

  • Warning: To avoid duplicate data, choose either the standard GA4 implementation or this bespoke GTM method. Do not enable both for the same tracking ID.

  • Have a list of the specific conversion actions you want to track (e.g., "Begin Checkout" vs. "Purchase").


Step-by-step:

1. Locate and Share your GTM Container ID

The platform needs your unique Container ID to "inject" your tracking tags into the storefront.

  1. Log in to your Google Tag Manager account.

  2. Open the relevant container for your property.

  3. In the top right corner (near the Submit/Preview buttons), look for the code starting with GTM-XXXXXX.

  4. Copy this ID and send it to your Ecommerce Platform account manager or support contact.


2. Configure Event Triggers

To track specific actions, you must create triggers in GTM that listen for our platform's "Custom Events."

  1. In GTM, click Triggers > New.

  2. Select Trigger Type: Custom Event.

  3. Enter the exact Event Name from the table below based on what you want to track:

Description

GTM Event Name

Viewing a specific room, spa day, or product

view_item

Adding any item to the basket

add_to_cart

Opening the basket page

view_cart

Entering the checkout (Guest or Sign-in)

begin_checkout

Entering payment details

add_payment_info

Successful Transaction Completed

orderComplete

  1. Click Save. You can now use these triggers to fire your Ads or Meta tags.


3. Set Up Order Confirmation Variables

To track the Value of an order (e.g., for Google Ads Conversion Tracking), you need to pull data from the platform's Data Layer.

  1. In GTM, click Variables > User-Defined Variables > New.

  2. Select Variable Type: Data Layer Variable.

  3. Use the exact paths below to "fetch" the order data:

Desired Data

Data Layer Variable Name

Order Reference ID

ecommerce.purchase.actionField.id

Total Order Value

ecommerce.purchase.actionField.revenue

Shipping Amount (Retail)

ecommerce.purchase.actionField.shipping

Tax Amount

ecommerce.purchase.actionField.tax

  1. Click Save. These variables can now be inserted into your tracking tags to report the exact revenue of each sale.


Best practice:

Test with Preview Mode: Before "Publishing" your GTM container, always use the Preview (Tag Assistant) mode. Navigate through a test booking on your storefront to ensure the orderComplete event fires correctly and that the revenue variable is pulling the correct numerical value.


Important Notice:

Privacy Compliance: Ensure your GTM setup respects the guest's cookie consent choices. Third-party tracking scripts should only fire if the guest has accepted "Marketing" or "Analytics" cookies via the storefront's cookie banner.


    • Related Articles

    • Google Analytics 4 tracking

      Google Analytics 4 (GA4) Tracking ⏱ Estimated time: 10 minutes ? Role: Marketing Managers, SEO/Web Agencies, Data Analysts What you'll learn: How to locate and share your GA4 Measurement ID. How to prevent "Referral Self-Referral" issues by ...
    • Dashboards (overview and analytics)

      Dashboards (Overview and Analytics) ⏱ Estimated time: 5 minutes ? Role: General Managers, Revenue Managers, Marketing Teams What you'll learn: How to navigate the platform's real-time reporting interface. The difference between "Today's Overview" ...
    • What to include in your cookies and privacy policy

      What to Include in Your Cookies and Privacy Policy ⏱ Estimated time: 10 minutes ? Role: Data Protection Officers (DPO), Legal Teams, Ecommerce Managers What you'll learn: The core components of a legally compliant Privacy Policy. How to define and ...
    • Ecommerce platform | Rooms setup

      Within our ecommerce platform you have the ability to make changes to the name, description and images of all of your room types. IMPORTANT: If changes are made within our ecommerce platform, this will override anything being sent through from the ...
    • How to create a test order

      How to Create a Test Order ⏱ Estimated time: 10–20 minutes ? Role: Ecommerce Administrators, Revenue Managers, Marketing Managers What you'll learn: How to simulate a guest booking journey across different modules. Best practices for testing ...