How to track clicks on the "Book" button on a White Label using Google Analytics GA4

The entire process of setting up Google Analytics for White Label consists of three stages:

  1. Creating and setting up accounts in Google Tag Manager and Google Analytics.
  2. Defining parameters for tracking actions on White Label.
  3. Checking statistics in Google Analytics.

Creating and setting up accounts in Google Tag Manager and Analytics

  1. Go to Google Tag Manager and create a new account.
  2. Fill in the following fields:
    • Account Name: Enter any name, such as the name of your White Label.
    • Country: Select the country where your main traffic comes from (e.g., Netherlands).
    • Container Name: Enter the URL of your White Label.
    • Target Platform: Choose "Website."
  3. Click Create and accept the Terms of Service agreement. A window with the Tag Manager code will appear.
  4. Copy the code from the first field and place it in the code blocks in the White Label settings under the Metadata tab, then save the changes.

    Important! The code needs to be placed on all page types (Main, Flights result, Hotels result, Hotel preview). Additionally, make sure the code is added to all language blocks. If you’ve added three languages to your White Label, the code should be placed on all three languages for all page types.
  5. Copy the code from the second field in Tag Manager and place it in the Header section in the My Blocks tab at the very top, then save the changes.

    Important! The code needs to be added for all languages you've added to your White Label.
  6. Go to Google Analytics and create a new property (Admin -> Create -> Property).

Note! If you don’t have an account in Google Analytics, create a new one and the system will take you to a Property creation page automatically.

  1. Fill in all fields in steps 1-3. On the final step, select Web.
  2. Set up a web stream by entering your website's URL and name.
  3. Click Create and continue.
  4. After this, you will receive a Stream ID. Click on it.

Note: If Set up a Google tag window appears, ignore and close it.

  1. In the Web stream details window, copy the Measurement ID.
  2. Go back to Google Tag Manager and create a new tag.
  3. In the Tag Configuration field, select Google Analytics -> Google Tag.
  4. Enter the previously copied Measurement ID into the Tag ID field. In the Triggering field, select All pages.
  5. Publish all changes by clicking Submit on the main Google Tag Manager page.

Defining parameters for tracking actions on White Label

Page views, scroll events, and other basic actions will automatically be collected in Google Analytics. To track clicks on the "Book" button, follow these steps:

  1. Go to Google Tag Manager and configure a new built-in variable.
  2. Click Configure and check the boxes for Click Element and Click Classes.
  3. Go to the Triggers tab and click New. Here, we'll define the conditions that must be met for a click on the "Book" button to be recorded in the statistics.
  4. In the opened window, select Click -> All Elements as the trigger type. Then, set Some Clicks under the activation conditions. Choose Click Classes -> contains.
  5. You can find the class of the "Book" button using the browser's developer tools. To do this, go to your White Label site, perform a search to reach the flight search results page.
    • On the results page, open the developer console (press F12 or right-click -> Inspect) and click the icon in the top-left corner of the console window:
    • Hover over the "Book" button. On the right, the element's class will be displayed. In this example, it is ticket-action-button-deeplink ticket-action-button-deeplink--.
  6. Insert this value into the trigger field and save the changes.
  7. Go to the Tags section and create a new tag.
  8. In the Tag Configuration field, select Google Analytics -> GA4 Event Tag.
  9. In the opened window, enter the Measurement ID from Google Analytics (obtained earlier or available in Admin -> Property Settings in Analytics).
    In the Event Name field, enter a name by which you would like to search for events in Google Analytics, such as a book.
  10. In the Trigger field, select the previously created trigger.
  11. Save the settings.
  12. Publish all changes by clicking Submit on the main Google Tag Manager page.

Checking statistics in Google Analytics

  1. Go to Google Analytics and open the Reports tab.
  2. Select Real-Time Report.
  3. In this report, you can see all recorded events. At the bottom of the screen, you'll find the Event Count broken down by parameters.
  4. Go to your White Label site and click the "Book" button. Ensure that the click is recorded in the statistics with the name you set earlier.

Repeat these steps for the other items for which you want to track clicks.