How to Implement E-Commerce Tracking in the Booking Engine

Modified on Wed, 18 Jun at 9:09 AM


Tier 3 and above customers will have access to RoomRaccoon’s e-commerce tracking on the booking engine (BE). This feature enables detailed tracking of booking conversions, values, and room types — all essential for optimizing advertising campaigns and measuring ROI.

We strongly recommend using Google Tag Manager (GTM) for implementing this tracking. GTM offers the greatest flexibility for managing tags, triggers, and variables without requiring direct changes to the website or booking engine code. It also makes integrating with third-party platforms such as Google Analytics 4, Google Ads, and Meta Pixel easier.


By following the guide below, you'll be able to:

  • Capture booking data with every reservation confirmation

  • Push structured e-commerce events into your analytics tools


See Google Developer Guides here


Prerequisites

Before you begin, make sure you have:

  • A Google Tag Manager account set up.

  • Access to the GTM container embedded in your RoomRaccoon Booking Engine (contact support if unsure).

  • A Google Analytics 4 (GA4) property connected

  • E-commerce tracking enabled in GA4 under Admin > Data Streams > Web > Enhanced Measurement.



GTM Import Template: Pre-configured Ecommerce Tracking

To simplify setup and ensure consistency, RoomRaccoon provides a ready-to-import GTM container template. This container includes prebuilt tags, triggers, and variables that capture all key e-commerce events on the booking engine, including:

  • purchase

  • add_to_cart

  • begin_checkout

  • add_payment_info

  • search

  • login


What's in the container:

  • Tags:

    • GA4 configuration tag (var_GA4_ID)

    • GA4 event tags for purchase, add_to_cart, search, etc.

  • Triggers:

    • Custom event triggers for each e-commerce event

  • Variables:

    • Predefined GA4 ID variable (var_GA4_ID)

    • Built-in variables enabled (Page URL, Referrer, etc.)

This version has been cleaned of all legacy/testing tags — it's production-ready and focused solely on e-commerce events.


Download the GTM Template (Pre-configured)

To get started quickly, download RoomRaccoon’s pre-configured GTM container designed specifically for e-commerce tracking on the booking engine.

Click here to download the GTM Container JSON (v21)


This container includes all the necessary:

  • GA4 event tags (purchase, add_to_cart, begin_checkout, etc.)

  • Custom triggers

  • Prebuilt GA4 configuration

  • Variables, neatly grouped under NEW events folder

 Reminder: This file is zipped. Unzip it first, then import the .json into your GTM workspace.


Important: Update Your GA4 Measurement ID


After importing:

  1. Open GTM > Variables

  2. Locate **var_GA4_ID**

  3. Replace **G-1MDBS4KE2X** with your actual GA4 ID

  4. Test via debug to your Booking engine 

  5. Save before publishing

If you don’t do this, your data will be sent to RoomRaccoon’s test account and not your own.

Preview & Test

  • Use GTM Preview mode to verify tags are firing

  • Open GA4 DebugView to confirm event transmission


Publish

  • Once tested, submit and publish the container version

Permissions & Access

If your GTM is managed by a third party or developer:

  • Send them the container file and these instructions.

  • Ensure they understand this is RoomRaccoon’s recommended implementation.


Cross-Domain Tracking: Ensuring Seamless Attribution

If your hotel’s main website and the RoomRaccoon Booking Engine (BE) are on different domains, you need to configure cross-domain tracking. This ensures that user sessions aren’t split across domains, and conversion attribution remains accurate in Google Analytics 4 (GA4).

Example Use Case


Without cross-domain tracking, a user who clicks “Book Now” and completes a reservation will show as two separate sessions in GA4, often marking the source as “Direct” or “Referral” — distorting your marketing data.

How to Set Up Cross-Domain Tracking in GTM

Step 1: Enable GA4 Tag Modification

If you’re using the provided GTM template, locate the **GA4 Tag** (type: googtag) or **settings 4 GA4 New** variable.

  1. Open the GA4 configuration tag OR the GA4 settings variable (used by the GA4 tags).

  2. Add a new field under Fields to Set (if not already present):

    • Field Name: linker

    • Value: true

  3. Enable cross-domain linking:

    • Under “Cross-domain tracking”, add both domains:

      • www.hotel-website.com

      • booking.roomraccoon.com

Step 2: Modify Auto Link Domains

In the same GA4 tag or settings variable:

  • Add the following field:

    • Field Name: autoLinkDomains

    • Value: www.hotel-website.com,booking.roomraccoon.com (comma-separated list)

Note: Ensure that all links from your hotel website to the BE use standard <a> elements or buttons that preserve URL parameters.

Testing Cross-Domain Tracking

After publishing:

  • Use the GA4 DebugView and Tag Assistant to simulate a booking journey from your website to the RoomRaccoon BE.

  • Look for a single session in GA4 across both domains.
    Check the session_source and session_medium to confirm attribution is preserved.

Final Reminder

If you're using the RoomRaccoon GTM template, don’t forget:

  • You must still enable and configure cross-domain tracking manually.

  • This is not automatically set in the template because each property has different domain needs.


GTM Variables for Booking Data

For pushing transaction values into other tracking tags you need to setup 3 variables that will capture the transaction ID, Currency code & transaction value. This is how to do it.

These variables pull data from the dataLayer.push() on the RoomRaccoon booking confirmation page (e.g. after event: "purchase").


1. DLV_TransActionID

  • Variable Type: Data Layer Variable

  • Variable Name: DLV_TransActionID

  • Data Layer Variable Name: eventModel.transaction_id


Notes: Captures the unique booking reference (e.g. RR123456)


 2. DLV_Currency

  • Variable Type: Data Layer Variable

  • Variable Name: DLV_Currency

  • Data Layer Variable Name: eventModel.currency

  • Notes: ISO currency code used in the transaction (e.g. EUR)

3. DLV_PurchaseValue

  • Variable Type: Data Layer Variable

  • Variable Name: DLV_PurchaseValue

  • Data Layer Variable Name: eventModel.value

  • Notes: Total booking amount (e.g. 354.00)

Testing Tips

Once created:

  • Use Preview Mode in GTM to ensure all three variables populate correctly when the purchase event is triggered.

  • Use Variables tab in the GTM debugger to confirm real values are shown (not undefined or blank).

  • These variables can be used across multiple tag types: GA4, Meta Pixel, Google Ads Conversion, etc.

Meta Pixel Purchase Event Setup in GTM

This is how you will use it in Meta Pixel.

1. Create a New Tag

  • Tag Type: Custom HTML

  • Tag Name: Meta Pixel - Purchase


HTML Code

html

CopyEdit

<script>

  fbq('track', 'Purchase', {

    value: {{DLV_PurchaseValue}},

    currency: '{{DLV_Currency}}',

    contents: [{

      id: '{{DLV_TransActionID}}',

      quantity: 1

    }],

    content_type: 'product'

  });

</script>


This sends a Purchase event with the correct booking value, currency, and transaction ID using the three GTM variables.

 2. Set the Trigger

Attach your existing purchase event trigger, which listens for the RoomRaccoon confirmation push:

  • Trigger Type: Custom Event

  • Event Name: purchase

  • Trigger Name: Purchase_event_Trigger

3. Test Your Setup

Before publishing:

  1. Enable Preview mode in GTM

  2. Complete a test booking on your RoomRaccoon BE

  3. Confirm the following in Meta Pixel Helper or Meta Events Manager:

    • Event fires as Purchase

    • Value and currency are accurate

    • Transaction ID is passed as contents.id

 Pro Tips

  • Ensure the Meta Pixel base tag is present on all pages (or loaded via GTM separately).

  • If you use Consent Mode, make sure the tag honors appropriate triggers or consent settings.

  • Add tag sequencing to delay the Purchase tag until the base pixel is loaded.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article