Note: If you are visiting this article after receiving a notification of changes to DBM and Google Analytics - please jump straight to the troubleshooting section (click here)
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 domains you want to include in the cross-domain measurement (see the image below -we are showing "yourhotelwebsite.co.uk" as an example)
-
The domains need to be, the top level domain of your own website(s) plus
- guestline.net
- guestline.app
Click Save.
Set up the Google Analytics 4 Google Tag
Step 1: Create a new Google Tag
Start by creating a Google 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., "Google Tag - My Hotel").
- Click "Tag Configuration"
- In the "Choose Tag Type" select "Google Analytics"
- Select "Google Tag"
-
Configure your tag:
- In the field Tag ID, enter your "G-" ID.
- Click on the "Configuration Settings" tab
- On the Configuration Parameter field, add the value "send_page_view" and set the value as "true" (see the image below)
Step 2: Create a trigger
Next, set up a trigger to load the Google Tag when someone loads your website.
- To ensure that the Google 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 Tag is 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.
- 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").
- Click "Google Analytics" on the Choose Tag Type option
- 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.
- IMPORTANT: Under "More Settings" make sure you tick the "Send Ecommerce data" under Ecommerce and select the "Data Layer" as the data source.
- On triggering, select the “Custom Events” trigger you have just created above.
Don't forget to 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.
Troubleshooting
I received a notification that I need to make changes to my Google Analytics to maintain cross domain tracking (July 2024) To ensure DBM is compliant and secure, we are making some changes that could affect your tracking. The URL for DBM is changing - and this could mean that if you have not previously configured your Google Analytics account to track the correct domains as noted in this guide, you may see your DBM traffic as "referral" or "organic" instead of a continuation of the website journey. Important! You need to make the following changes to your Google Analytics configuration, please ensure you have completed Step 7 (see here) Pay particular attention to ensuring that the Cross Domain Linking section contains "guestline.app" in the included domains. If it's already there, you're all set! Be also sure to check out the guide for ensuring your hyperlinks to DBM in emails, social, and your other areas of digital marketing are set up correctly. Read more about these changes here - you need to ensure these are completed by the end of September 2024 to ensure your visitors can still use DBM. |
Why don't I see the right revenue in the GA4 reports?
While Google is expected to perform currency conversion based on the currency settings defined in your site configurations, it appears that this feature may not be functioning correctly at this time. To resolve this, please ensure that the currency of your DBM site matches the currency configured in your site settings.
I stopped receiving reservation data after July 2023
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.
Comments
0 comments
Article is closed for comments.