How to use Google Tag Manager with Resos

In this article
  1. Why GTM can’t load directly on the booking page
  2. Prerequisites
  3. Option 1: Embed the widget on your website
  4. dataLayer event format
  5. Event names
  6. Example GTM trigger
  7. Option 2: Listen for postMessage events (iframe)
  8. postMessage format
  9. Example listener
  10. Verify it worked

This guide explains how to capture booking events from the Resos widget using Google Tag Manager on your own website.

Why GTM can’t load directly on the booking page

For security reasons, it is not possible to load a custom Google Tag Manager container on the Resos-hosted booking page. GTM containers can execute arbitrary code, which would be a security risk on a shared platform.

GTM info in Resos settings

Instead, Resos pushes events to the dataLayer and sends postMessage events that your website can capture.

Prerequisites

  • The Marketing & Analytics add-on must be activated. See How to set up Marketing & Analytics.
  • The Resos booking widget embedded on your own website (where GTM is already installed)

Option 1: Embed the widget on your website

If you embed the Resos booking widget on your website where GTM is already installed, booking events are automatically pushed to the dataLayer. No extra configuration is needed - your GTM triggers will pick them up.

dataLayer event format

Each booking step pushes an event to window.dataLayer with a nested resosBooking block (the full block only appears on events that carry booking details):

{
  event: "ResosBookingComplete",
  event_category: "Resos",
  resosBooking: {
    guests: 4,
    date: "2026-04-15",
    time: "19:00",
    bookingId: "abc123",
    value: 1000,
    currency: "EUR",
    country: "DK",
    newCustomer: true
  }
}

When the guest has granted marketing consent, ResosBookingComplete also includes a resosUser block with SHA-256 hashed email and phone for Enhanced Conversions / Advanced Matching:

{
  event: "ResosBookingComplete",
  event_category: "Resos",
  resosBooking: { /* ... */ },
  resosUser: {
    emailSha256: "…",
    phoneSha256: "…"
  }
}

Event names

EventDescription
ResosPageViewPage navigation within the widget
ResosBookingStartBooking widget opened
ResosSelectExperienceGuest picked an experience on the experience step
ResosSelectRegularBookingGuest picked the regular (“A la carte”) booking option
ResosSelectGuestsGuest count selected
ResosSelectDateDate selected
ResosSelectTimeTime slot selected
ResosAddPaymentInfoPayment required (status changed to pending)
ResosPaymentPayment captured (status settled or authorized)
ResosBookingCompleteBooking confirmed
ResosBookingCancelGuest cancelled the booking
ResosSendMessageGuest sent an activity / chat message

Example GTM trigger

Create a Custom Event trigger in GTM:

  • Trigger type: Custom Event
  • Event name: ResosBookingComplete
  • This trigger fires on: All Custom Events

Then attach it to your conversion tag (Google Ads, Meta CAPI, etc.).

Option 2: Listen for postMessage events (iframe)

If the booking widget is loaded in an iframe, events are sent to the parent window via postMessage. This works even without GTM.

postMessage format

{
  type: "ResosEventForwarder",
  data: {
    event: "ResosBookingComplete",
    numGuests: 4,
    bookingDate: "2026-04-15",
    bookingTime: "19:00",
    bookingId: "abc123",
    value: 1000,
    currency: "EUR"
  }
}

Example listener

Add this script to your website to capture booking events and push them to the dataLayer for GTM:

window.addEventListener('message', function(event) {
  if (event.data && event.data.type === 'ResosEventForwarder') {
    var eventData = event.data.data;

    // Push to dataLayer for GTM
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
      event: eventData.event,
      ...eventData
    });
  }
});

Verify it worked

  1. Open your website with the embedded booking widget
  2. Open the browser console (in the widget iframe), run resos.debug(), and reload the page
  3. Look for [gtag] and [postMessage] entries as you interact with the booking flow
  4. In GTM, use Preview mode to verify that events appear in the debug panel
Line from the Resos support team Support team member Support team member

Still looking for help?

Can't find what you're looking for? Our support team is happy to help.