Adding Google Analytics to Your Widget

Gain deeper insights into visitor behavior and reservation activity using Google Analytics.
Integrating Google Analytics with your widget allows you to track user interactions and better understand how guests engage with your online booking process.

Note: Google Analytics tracking is only supported with the latest version of the widget. If you're using an older version, please visit the Widget Integration Page to update your HTML code or obtain the latest widget link.

Track Reservation Events in Google Analytics

To track when a reservation is created, you'll need to send a custom event to Google Analytics:

event name is: reservation_created
 
window.gtag('event', 'reservation_created', {
reservation_id: reservation.id,
party_size: reservation.guests,
created_at: dayjs().format('YYYY-MM-DD HH:mm:ss'),
});

Optional: Register the Event in GA4

GA4 will automatically detect custom events like reservation_created, but if you want more control or to use it in reports:

  1. Go to Admin > Events in GA4.

  2. Click Create Event to define it manually, or wait for GA4 to detect it (may take up to 24 hours).

  3. Once detected, locate reservation_created in the Events list.

Mark the Event as a Conversion (If Needed)

  1. In GA4, go to Admin > Events.

  2. Find the reservation_created event.

  3. Click Mark as Conversion.


Once configured, your Google Analytics account will begin receiving data from your widget, including page views and reservation-related events—depending on your implementation.

How to Remove Google Analytics Code

If you need to disable Google Analytics tracking:

  1. Return to the Third-Party Integrations section.

  2. Delete or clear the existing Google Analytics code from the input field.

  3. Toggle the Enable Gateway switch to the Off position.

  4. Click Save to confirm and apply your changes.

After this, your widget will stop sending data to Google Analytics.


Need Help?

If you have any questions or need assistance with the setup, feel free to contact us at support@tablein.com. We're here to help!