Skip to main content

Set up Google Analytics 4

Google Analytics 4 (GA4) is the next generation of analytics that introduces a standardised way of tracking events from both websites and apps. Read more here.

⚠️Google will stop processing data from Universal Analytics on 1st of July 2023 so if you haven’t changed to GA4, we recommend you to do so.

 

Before we get started with GA4

To start tracking events in your widgets, you need to create a GA4 property and embed it on your website:

 

How to activate GA4 on your widget

  • In the Google Analytics admin panel, locate the MEASUREMENT ID for your data stream and copy it. (picture above)
  • Go to Bókun and go to Settings > Sales settings > Booking channels
  • Select the booking channel
  • Go to the tracking step
  • Toggle the Google Analytics 4 tracking card and insert your MEASUREMENT ID into the input field

  • Now the GA4 should be working on your widget

 

How events are handled in the widgets (technical overview)

Normally, our booking widgets are embedded in iframes. GA4 events can’t be tracked within iframes that have a different domain (url) than the website that embeds the iframe. We bypass this by making our widgets send messages to the website that is embedding the widget and track it from there.

If you have a gtag script in your website, we pass the event parameters into that function, but if gtag is not present, we try to push the event parameter into the dataLayer (for Google Tag manager).

 

Verifying that your events are being tracked

To verify that your events are being tracked propperly, use the debug view in the Google Analytics panel.

If you go to your website and add a product to cart, you should be seeing an add_to_cart event in the debug view. If you are not seeing it, consider the following:

  • Is Google Analytics 4 active on your Bókun booking channel?

    • Check your booking channel tracking step. Is GA4 active?
  • Is the Google Analytics 4 tracking code embedded on your website?

  • Have you disabled tracking on your Booking Channel until consent is given?

    • Check your booking channel tracking step. Are you awaiting tracking consent? If so, make sure your website is not awaiting tracking consent.

     

Events

In addition to the regular events tracked by GA4 (page-view, scroll etc.) our widgets track the following events.

TriggerEvent nameProperties
A search is performed on a product list widgetsearchsearch_term: The term that was searched

date_from: The start date selected

date_to: The end date selected
A purchase is completedpurchasecurrency: The currency used for the payment

transaction_id: The id of the new booking

value: The value of the booking in the currency used

affiliation: Bokun widgets

coupon: The promo code used

tax: The value of the tax in the currency used

items: The items bought
A product is added to cart_add_to_cartcurrency: The currency used for the payment

value: The value of the item in the currency used

items: The item added to cart
Checkout beginsbegin_checkoutcurrency: The currency used for the payment

value: The value of the cart in the currency used

coupon: The promo code used

items: The items in the cart
A product is removed from cartremove_from_cartcurrency: The currency used for the payment

value: The value of the item in the currency used

items: The item removed from cart

A product list item is clickedselect_itemitem_list_id: The id of the product list

item_list_name: The title of the product list

items: The id of the product selected

A product list is viewedview_item_listitem_list_id: The id of the product list

item_list_name: The title of the product list

items: The ids of the products in the list

A product page or a calendar is displayedview_itemcurrency: The currency selected value: The default price displayed

items: The id of the product viewed

|

 

Properties of items

Property nameDescription
item_idThe id of the product
item_nameThe title of the product
quantityThe quantity of the item
priceThe unit price of the item
currencyThe currency of the price
discountThe unit discount of the item

 

⚠️ We currently do not support GA4 tracking for WIX websites. The reason being that when we embed widgets in Wix they are put inside iframes, so we can’t send google event messages to the top window.