Enabling e-commerce tracking is important and requires working together with your booking engine provider. Once your booking engine installed Google's e-commerce script you can see how much revenue your website is generating. Without e-commerce tracking you would only see clicks but no revenue generated through these clicks.

Adding the tracking code to your booking engine confirmation page:

The following code can be copied and pasted directly into your booking engine’s confirmation page. Just forward this to your booking engine provider.

⚠️ Replace all the variables in bold with your specific variables ⚠️

  • Place the script in the HTML header
  • Don't know your variables? Contact your Booking Engine, as this can be provided by them
  • All instructions in italic after // can be removed


<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-XXXXX-Y', 'auto');   //  Add your Google Analytics UA here
    ga('require', 'linker');
    ga('linker:autoLink', ['www.hotelwebsite.com']);     // Add your website domain here
    ga('send', 'pageview');

  ga('require', 'ecommerce');

ga('ecommerce:addTransaction', {
'id': '546473035949', //     Add the Transaction ID Booking Confirmation Number Here
'affiliation': 'Hotel Name', //     Add the name of the hotel here
'revenue': '12.34', //     Input the Grand Total of booking - before tax
'shipping': '' , //    Shipping cost - leave blank
'tax': '13.69' }); //    Add the total tax for the booking

ga('ecommerce:addItem', {
'id': '10426', //    Transaction ID or Booking Confirmation number
'sku': '122201', //    If you assign an ID for room types you can add here
'name': 'Studio, Standard' //    Input the room category booked
'category': 'Best Available Rate', //    Input Rate Typed Booked
'price': '98.1', //    Average daily rate of booking before tax
'quantity': '1'}); //   Number of nights booked

ga('ecommerce:send');
</script>


If you have any questions on this or any other topics, use our chat to ask a Champ for help. 

Did this answer your question?