Note: If your old UA analytics account has been migrated to GA4 and you stopped receiving reservation data (and revenue values) during early July 2023, it is likely you are still tracking the old "transaction" event from UA. Please read this guide to ensure you are tracking Google's new events for GA4 to resolve.
This is a step-by-step simple guide for setting up cross-domain tracking in your Google Analytics 4 (GA4) so it can work with DBM.
This guide assumes that you've already got a Google Tag Manager account. If not please create one before proceeding using the documentation provided by google.
Create an Analytics account
Your first step is to set up an Analytics account, unless you already have one. Skip to creating a property step below.
- In Admin, in the Account column, click Create Account.
- Provide an account name. Configure the data-sharing settings to control which data you share with Google.
- Click Next to add the first property to the account.
Create a new Google Analytics 4 property
You need the Editor role to add properties to a Google Analytics account. If you created this account, you automatically have the Editor role.
To create a property:
In Admin, look at the Account column to make sure that you've selected the right account. Then, in the Property column, click Create Property.
- Enter a name for the property (e.g. "My Hotel, Inc website") and select the reporting time zone and currency.
- Follow all the on screen instructions and click Create.
- Continue to Add a data stream to start collecting data.
Add a data stream
In Admin, look at the Account column to make sure that you have your desired account selected. Then, look at the Property column to make sure that you have your desired property selected.
In the Property column, click Data Streams > Add stream.
-
Click Web when choosing the platform.
- Enter the URL of your primary website, e.g., "myhotel.co.uk", and a Stream name, e.g. "Example, Inc. (My Hotel)".
- You have the option to enable or disable enhanced measurement. Enhanced measurement is how we automatically collect page views in DBM, so please leave this setting on (which it is by default).
- Click Create stream.
Set up cross-domain measurement via the Admin
This step is very important as it will allow the communication between the hotel domain and DBM, so we can cross track the user / guest between the two sites.
- In Admin, click Data Streams in the Property column.
- Click on the new data stream you’ve just created on the previous step.
- In the web stream details, click Configure tag settings (at the bottom).
- In the Settings section, click Configure your domains.
- Under Include domains that match ANY of the following conditions:
- Click Add condition to add the two domains you want to include in the cross-domain measurement.
Click Save.
Set up the Google Analytics 4 Configuration tag
Step 1: Create a GA4 Configuration tag
Start by creating a Google Analytics: GA4 Configuration tag to send data to your Analytics property.
- In Google Tag Manager, click Tags > New.
- Enter a name for the tag at the top (e.g., "GA4 Configuration - My Hotel").
- In the Tag Configuration box, select Google Analytics: GA4 Configuration.
-
Configure your tag:
- In the field Measurement ID, enter your "G-" ID.
- Keep the Send a page view event when this configuration loads option checked to automatically send pageview events.
Step 2: Create a trigger
Next, set up a trigger to load the Google Analytics: GA4 Configuration when someone loads your website.
- To ensure that the Google Analytics 4 Configuration tag fires before other triggers, click Triggering and use the All Pages. Learn more about Page triggers.
- Save the tag configuration.
Result
Your tag configuration should look like this:
Step 3: Verify your tag works
To make sure your tag works as intended:
- In Google Tag Manager, click Preview. The Tag Assistant opens.
- Enter your site's URL.
-
Check if the Google Analytics: GA4 Configuration fired when the page loaded.
-
✅ If your tag fired successfully, the Tag Assistant UI look like this:
- ❌ If your tag didn't fire, check your tag's trigger settings.
-
✅ If your tag fired successfully, the Tag Assistant UI look like this:
- When you are done with debugging, close Preview mode.
- In your Workspace, click Submit to publish your changes.
Please ensure you always Submit when making changes, otherwise they will not be published and go live.
Set up the Trigger for Custom Events
Create a trigger so we can register the events that DBM is emitting. This will ensure tag events that are sent from DBM such as the purchase event (conversion) and others e-commerce events get to show on your analytics report. We will later use this trigger with the GA4 Event Tag.
- In Google Tag Manager, click Triggers > New.
- Enter a name for the trigger at the top (e.g., "Custom Events").
- Select Custom Event on Trigger Configuration.
- Under Event name:
- If you would like to ignore internal gtm events, so they do not pollute your analytics events report add ^(?!.*gtm).* This will include automatically the new 'purchase' event for tracking reservations.
- If you would like to see all events, including gtm internal events, simply add .*
On this trigger fires on, select “All Custom Events”
Save your changes.
Set up the Google Analytics 4 Events tag
Start by creating a Google Analytics: GA4 Event tag. This will ensure tag events that are sent from DBM such as the purchase event (conversion) and others get to show on your analytics report.
- In Google Tag Manager, click Tags > New.
- Enter a name for the GA4 Event tag at the top (e.g., "GA4 Events").
- Select Google Analytics: GA4 Event.
- Under Configuration Tag, select your Google tag.
- In Event Name, Click on the Add Icon and select Event. This will ensure any custom events show on your GA4 reports.
- On triggering, select the “Custom Events” trigger you have just created above.
Save and publish your changes.
DBM Ecommerce events
We have set up the recommended ecommerce events to publish information about the behaviour of your users. These events will enable you to quantify your most popular products and see the influence of promotions and product placement on revenue.
- view_item_list
This event is published when a user is presented with a list of product results. It will include the list of items viewed by the user and some other useful metadata. On DBM, this happens when a user views room or extras availability results.
Example
- add_to_cart
This event is published when an item is added to the basket. It will include relevant details about the item that was added. On DBM, this will apply for both room and extra items.
Example
- remove_from_cart
This event is published when an item is removed from the basket. It will include relevant details about the item that was removed. On DBM, this will apply for both room and extra items.
Example
- purchase
This event is published when someone makes a purchase. It will include all relevant details about the purchase. On DBM, this will happen when the user reaches the confirmation page.
Example
Supported properties
Please note that the entire list of properties passed in the events can be found here. Apart from the “required” properties, we also send the following ones:
- GA4 recommended but not required:
-
-
affiliation (used to pass the site id)
-
coupon (used for promo codes)
-
item_category (indicates if it's a room or an extra)
-
item_variant (indicates the name of the rate plan)
-
-
Guestline specific properties:
- check_in_date (date of arrival)
- check_out_date (date of departure)
- nights (number of nights for the stay)
- adults (number of adults in the reservation)
- children (number of children in the reservation)
We also encourage you to make use of the Google Analytics Debugger to check the data being sent.
Comments
0 comments
Article is closed for comments.