resmio » Help » Integration »
Tracking conversions with Google Tag Manager (GTM)
· Track key widget events using Google Tag Manager (GTM)
· Send events/conversions to GA4, Meta, and others
· Evaluate the success of your marketing campaigns
Overview
EXPERT SETTING To track the success of your online marketing campaigns for any restaurant, we’ve created essential features to track resmio’s reservation widget via Google Tag Manager (GTM).
resmio pushes specific events in the widget to the data layer.
Using triggers set in GTM, you can send the signals back to Google Analytics (GA4), for instance, and track the steps from the landing page (like the restaurant page) to the first user interaction with the widget to the reservation.
The following preparations should be made:
- A GTM account (with pre-installed web container)
- A GA4 account including property (with pre-installed GA4 tag on website)
- The resmio widget (integrated as a script on the website)
- GTM conversion tracking is enabled in the resmio account
GTM tracking is disabled by default, but you can enable this feature under Settings > Integrations > Marketing. Agencies should contact their restaurant clients directly for this.
PostMessage allows the resmio widget (as an embedded iFrame) to securely communicate with the website on which it is embedded.
- Every time something happens in the widget—e.g., a click, a step change, or a reservation being submitted—the widget sends a message (postMessage) to the website.
- This event is then received by Google Tag Manager, logged in the data layer, and can then be further processed in GA4, for example.
- This allows the widget to be tracked consistently without having to directly modify the widget code.
We currently send the following events to GTM:
widget_interaction_started
Triggered upon first user interaction with the widget (e.g., tapping on booking time, selecting group size, opening calendar)
reservation_step_2_started
Triggered when switching to the checkout screen (contact details entry)
reservation_completed
Triggered upon successful online reservation
We send all of the above events with a timestamp to the data layer.
We always include the following data:
- timestamp · Timestamp of the interaction · Example:
2025-12-05T12:23:35.430Z - facility_id · Indicator for the respective restaurant · Example:
my-restaurantname - promotion · Name of the selected offer period · Example:
happy_hour
You can (optionally) share this data with GA4, for example, for further analysis.
We have implemented Google Tag Manager, GA4, and a sample widget on our demo website resmio Steakhouse (fictional restaurant).
All widget events are also logged in the browser console in our setup.
- Right-click on the website > Inspect
- Switch to the Console tab
- Trigger the widget signals on the website and observe the console
GTM-Tracking-Setup
The first step is to set up the listener tag in GTM.
This tag’s purpose is to tell Google Tag Manager to wait for certain events and send specific data (e.g., to GA4) when the preset actions occur.
Here’s how to do it:
- Open your GTM container (workspace).
- Then click on Tags in the page list on the left.
- Create a new tag using the New button.
- Select the tag type Custom HTML in the tag configuration
- Choose a meaningful title for the tag and copy the following code.
<script>
window.addEventListener('message', function(e) {
if (!e.data || e.data.event !== 'resmio_widget_action') return;
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: e.data.step, // 'widget_interaction_started', 'reservation_step_2_started', 'reservation_completed'
timestamp: e.data.timestamp,
facility_id: e.data.facility_id,
promotion: e.data.promotion
});
});
</script>
The code should look like the screenshot above. This will keep the listener running continuously on the page and intercept all postMessage events from the widget.
All pages should be preselected as triggers.
Please don’t forget to save your custom HTML tag.
Now we need a dedicated custom event trigger for each step in our funnel.
In our setup, we need a total of 3 triggers for 3 custom GA4 tags, which we will then link to the triggers.
widget_interaction_started
Triggered upon first user interaction with the widget
reservation_step_2_started
Triggered when switching to the checkout screen (contact details entry)
reservation_completed
Triggered upon successful online reservation
Here’s how to do it:
- Open your GTM container (workspace).
- Then click on Triggers in the page list on the left.
- Create a new custom event trigger using the New button
- Select Custom Event as the trigger type
- Assign a descriptive event title and select “All custom events” as the trigger condition.
- Repeat steps 3 through 5 until you have a total of three triggers.
Once all triggers have been created, you can set up custom tags for GA4 (or Meta, TikTok, etc., if you prefer) and then link them to the triggers in Google Tag Manager.
Below, we outline a setup for Google Analytics 4.
Here’s how to do it:
- Click on Tags in the side menu on the left
- Create a new tag using the New button
- Select the tag type Google Analytics in the tag configuration
- Add the GA4 measurement ID from your property
- Select a meaningful event title
- Now link the custom tag to the appropriate trigger
- Repeat the steps for all events
This is what your finished tracking setup for GTM and resmio could look like:
Don’t forget to push all changes to GTM for them to take effect. To complete this, click on Submit in the header bar at the top right.
(Optional step) We provide additional data with the widget events, which you can pass on to GA4, for instance.
- timestamp · Timestamp of the interaction · Example:
2025-12-05T12:23:35.430Z - facility_id · Indicator for the respective restaurant · Example:
my-restaurant-name - promotion · Name of the selected offer time · Example:
happy_hour
To use the data for your evaluations in GA4, you need…
- … corresponding data layer variables in GTM, which you link to the GA4 events.
- … custom definitions (custom dimensions) in GA4 that contain the event parameters
Creating variables in GTM
Here’s how to do it:
- Open your GTM container (workspace).
- Then click on Variables in the page list on the left.
- Create a new custom variable using the New button
- Select Data Layer Variable as the variable type
- Now enter the following values: Variable name, e.g.
DLV - facility_id, data layer variable namefacility_idSave this variable. - Repeat the steps for the data layer variables
promotionandtimestamp
Link variables to GA4 tags
Once the variables have been created in Google Tag Manager, all you need to do is link them to the matching GA4 tags (as shown in the screenshot above).
In our example setup, we connect the data layer variables to all three GA4 tags.
Here’s how to do it:
- In GTM, click on Tags
- Edit any GA4 tag
- Add the corresponding event parameters to the respective GA4 tag:
- Event parameter:
facility_idhas the value{{DLV - facility_id}} - Event parameter:
promotionhas the value{{DLV - promotion}} - Event parameter:
timestamphas the value{{DLV - timestamp}}
- Event parameter:
Save the changes and repeat the steps for the remaining GA4 tags.
Create custom dimensions in GA4
Finally, we need appropriate custom dimensions for GA4 so that Google Analytics can store, evaluate, and report them. This is because GA4 cannot track our additional widget data out of the box. We first have to teach GA4 these event parameters.
How to create custom dimensions in GA4:
- Go to GA4 and then to Admin > Data View > Custom Definitions.
- Then click on the button in the top-right corner Create Custom Dimension
- Assign a meaningful dimension name and, if necessary, a description. The scope of application for our custom definition is Event / Event.
- Now add the respective event parameter from the GA4 tag from GTM, making sure to use the correct spelling (upper and lower case letters!). Example:
facility_id - Save your custom dimension and repeat the steps for all other data layers.
Once setup is complete, we recommend testing tracking in Google Tag Manager and GA 4.
After you have sent the changes to GTM:
- Switch to debug mode by clicking on Preview in the header bar at the top right
- Enter the URL of the website where the GTM web container and the resmio widget are embedded
- You should be successfully connected to the tag assistant (see screenshot above). If not, please check the integration of the web container on the website
- Trigger the signals in the reservation widget, exit the tag assistant, and finally check whether the tags have been triggered
- Open either the Debugview or the Real-time report overview in Google Analytics 4
- Trigger the corresponding widget events and check in GA4 whether the data has been sent.
- The submitted events should appear in GA4 after a few minutes under Admin > Events. If this is not the case after testing, check under Admin > Data Collection and Modification > Data Filters to see if internal traffic is excluded and, if necessary, temporarily disable the option.
Are the widget signals being properly sent from GTM to GA4?
If so, you can now use this data to set up a funnel using exploratory data analysis, for instance, and track the various steps in user interaction from page view to completed reservation.
Here’s how:
- Open the relevant GA4 property
- In the sidebar on the left, click Exploratory Data Analysisand then Exploratory Funnel Analysis
- Edit the steps you have created in Settings > Steps: Add all events one after the other (page_view, widget_interaction_started, reservation_step_2_started_reservation_completed).
- You can use dimensions to segment the funnel by device category, traffic sources, etc.




















