Skip to main content

Guestline Direct Booking Manager: Create Google Analytics 4 (GA4) cross-domain tracking

This guide assumes that you've already got a Google Tag Manager account.

Xanthe Jackson avatar
Written by Xanthe Jackson
Updated over a week ago

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.


Important: If you are visiting this article after receiving a notification of changes to DBM and Google Analytics - please jump straight to the troubleshooting section at the end of this article.

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.
To create an analytics account, follow the steps below:

  1. In Admin, in the Account column, click Create Account.

  2. Provide an account name. Configure the data-sharing settings to control which data you share with Google.

  3. 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, follow the steps below:

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.

IMAGE or VIDEO PLACE HOLDER

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. GA4 now features an enhanced onboarding assistant that auto-suggests industry-relevant settings, helping you configure your property faster and with fewer errors.

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, then Add stream.

Click Web when choosing the platform.

IMAGE or VIDEO PLACE HOLDER

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

Important: This step is vital as it will allow the communication between the hotel domain and DBM, so we can cross-track the user between the two sites.

To set up cross-domain measurement via the admin, follow the steps below:

In Admin, click Data Streams in the Property column.

Click on the new data stream you’ve just created.

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

Tip: 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.app

Click Save once completed.

IMAGE or VIDEO PLACE HOLDER

Set up the Google Tag

Note: This is now simply called the Google Tag - previously known as Google Analytics 4 Configuration tag. The functionality remains the same.

Step 1: Create a new Google Tag

To create a Google Tag to send data to your Analytics property, follow the steps below:

In Google Tag Manager, click Tags, then click New.

Enter a name for the tag at the top. For example, 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.

Keep the Send a page view event when this configuration loads option checked to automatically send pageview events.

Step 2: Create a trigger

To set up a trigger to load the Google Tag when someone loads your website, follow the steps below:

To ensure that the Google Tag fires before other triggers, click Triggering and use the All Pages.

You can learn more about Page triggers.

Save the tag configuration.

Your tag configuration should look like this:

IMAGE or VIDEO PLACE HOLDER

Step 3: Verify your tag works

To make sure your tag works as intended, follow the steps below:

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: IMAGE or VIDEO PLACE HOLDER

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.

To set up the trigger customer events, follow the steps below:

In Google Tag Manager, click Triggers, then click New.

Enter a name for the trigger at the top. For example, 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 .*

IMAGE or VIDEO PLACE HOLDER

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.

To set up the GA4 events tag, follow the steps below:

  1. In Google Tag Manager, click Tags, then click New.

  2. Enter a name for the GA4 Event tag at the top. For example, GA4 Events.

  3. Click Google Analytics on the Choose Tag Type option.

  4. Select Google Analytics: GA4 Event.

  5. Under Configuration Tag, select your Google tag.

  6. In Event Name, click on the Add Icon and select Event. This will ensure any custom events show on your GA4 reports.

  7. Under More Settings make sure you tick the Send Ecommerce data under Ecommerce and select the Data Layer as the data source.

  8. On triggering, select the Custom Events trigger you have just created above.

Important: Don't forget to save and publish your changes.

IMAGE or VIDEO PLACE HOLDER


DBM E-commerce 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. Some of the events are reviewed below:

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:

IMAGE or VIDEO PLACE HOLDER

view_item

To ensure that GA4 correctly recognises the ecommerce purchase funnel we will trigger a "

view_item

" event when a guest adds a room to cart, as shown below:

IMAGE or VIDEO PLACE HOLDER

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:

IMAGE or VIDEO PLACE HOLDER

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. Find an example below:

IMAGE or VIDEO PLACE HOLDER

begin_checkout

This event is published when the user starts the checkout process on the summary page. It will include relevant details about the items that are being checked out, as shown below:

IMAGE or VIDEO PLACE HOLDER

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. Find an example below:

IMAGE or VIDEO PLACE HOLDER



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 - rooms only)

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 in "Set-up cross-domain measurement via the Admin".

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 yourhyperlinks to DBM in emails, social, and your other areas of digital marketing are set up correctly. 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.

Did this answer your question?