Skip to main content
Skip table of contents

How to track conversions with Google Analytics 4 (GA4)?

How can I check if visits to my website convert into reservations? How to use Google Analytics 4 with HBook to compare visits to my website and finalization of reservations?

Set up your Google Analytics

If you haven't a Google Analytics account set, with GA4 property and Data collection set, then follow the steps below, which are detailed in this article: https://support.google.com/analytics/answer/9304153 :

  1. Create an Analytics account

  2. Create a new Google Analytics 4 property

  3. Add a data stream for your "Web"

  4. Set up data collection for your website:

    • If you wish to use Google Site Kit, you will connect your Google Site Kit to your Google Analytics Property at this step. Google Site Kit takes care of adding the code on your website pages.

    • Don't forget the checkbox for "User Data Collection Acknowledgement" (in Admin - Data collection and modification - Data collection). No data will be collected until you acknowledge it.

Organize the booking steps in HBook

HBook allows you to split the booking process in different steps that can be done on different pages:

Step 1 - Search form page / Accommodation booking page

You will set the redirection to your "Main booking page" with the parameters "search_only" and "redirection_url".

  • On a global search form, you can set that the results of the search will be displayed on a different page. The user enters check-in date and check-out date, number of guests (if relevant) and is redirected to a different page. Here is an example of shortcode for this behaviour: [hb_booking_form search_only="yes" redirection_url="https://www.abc.com/main-booking-form"]

  • On a global search form, you can set that the user is redirected to a different page only once he has selected the accommodation he wishes to book. Here is an example of shortcode for this behaviour:
    [hb_booking_form redirection_url="https://www.abc.com/main-booking-form"]

  • On an accommodation form, you can set that the user is redirected after the results of his search. Here is an example of shortcode for this behaviour:
    [hb_booking_form accom_id="123" redirection_url="https://www.abc.com/main-booking-form"]

Step 2 - Main booking page : Extra-services, Customer details and Payment.

You will set the redirection to your "Thank you page" with the parameter "thank_you_page_url". On this second page (the "Main booking page"), you will have a booking form, and you can set a redirection for the last step. Here is an example of shortcode for this behaviour:
[hb_booking_form thank_you_page_url="https://www.abc.com/thank-you-page"]

Step 3 - Thank you page.

On this page, you will have a shortcode [reservation_summary]. The user will be redirected to this page only when the reservation is finalized, be it that an online payment is required or not.

Set up the conversions in GA4

With the above, we can create conversions in Google Analytics 4, for example, to get an idea of how many users actually go throw the different steps. As an example, here is how to set a conversion for users reaching the "Thank you page", which is when the reservation process has been completed (with or without online payment).

  • In Admin - Data display - Events, you will create an event as follows:

    create_event_analytics.png

  • In Admin - Data display - Conversions, you will set that this event is to be considered as a conversion:

    create_conversion_name_analytics.png

You can create different conversion events, to measure the page views of each step of the booking process. You will create a new event for each measurement.

For example, you can create an event "main_booking_page" and set is as a different conversion: by doing so, you compare how many visitors land on your website (automatically done with "Page Views" counts, switched on by default on GA4) with how many visitors reach your "Main booking page" and how many actually finalize their booking.

You can as well set additional parameters for a finer tuning of what you are tracking.

For example, let's say I wish to check how many finalized reservation are done from my page where I have an Accommodation list (in this example, the URL contains "accommodation-list"):

conversion_from_accom_list.png

Adding other Google Analytics scripts in HBook

For your information, HBook calls 2 different JavaScript functions during the booking process. You can use them to run specific scripts:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.