home > support > solution library > booking engine > tracking via google analytics
For an introduction to Google Analytics 4, including details of how to migrate your account from older Universal Analytics check Google's own Version 4 doocumentation.
JavaScript tracking tags can be placed on the first and last pages of the booking process via Configuration > Channels. This tutorial details some of the considerations for using this with the popular Google Analytics service however the techniques should be applicable to other similar solutions.
Where an OTA is using their own TourCMS booking engine links on their own website your JavaScript code will not be used, thus any bookings made via this method will not show in your Google Analytics.
Basic tracking will allow you to see visits to each step of the TourCMS booking process in your Google Analytics data.
Ecommerce tracking allows you to track customer purchases in Google Analytics. For some background, view Google's own documentation on ecommerce tracking with GA4.
TourCMS documentation tokens can be used to fill in the details of what the customer has booked, the tokens will be replaced by TourCMS before your tracking tags are displayed. For example adding the following to Step 5 - Thank you page:
<script>
gtag("event", "purchase", {
transaction_id: "%b_id%",
value: %b_base_sale_price_total_inctax_exlp%,
currency: "%b_sale_currency%",
coupon: "%promo_code%",
items: [
{
item_id: "%t_id%",
item_name: "%t_name_web%",
index: 0,
price: %t_price%,
quantity: %tour_quantity%
}]
});
</script>
At the time of writing cross domain iframe tracking using Google Analytics 4 is somewhat tricky, this is due to browsers increasingly blocking third party cookies.
You may wish to check this guide on third party Iframe tracking by Simho Ahava which goes into detail about the limitations of Google Analytics V4, and offers a solution avoiding the user of cookies and instead the tracking within the iframe (TourCMS) can be configured to push all dataLayer events to the parent (your website) without the use of cookies which are increasingly blocked on third party sites. Jump to the suggested solution.