How to set up Google Hotel Ads with your booking engine

Created by Katrín Magnúsdóttir, Modified on Wed, 27 Sep, 2023 at 1:01 PM by Katrín Magnúsdóttir

Add this code to the Booking Engine

<script>

  window.dataLayer = window.dataLayer || [];

  function gtag(){dataLayer.push(arguments);}

  gtag('js', new Date());

  gtag('config', 'AW-XXXXXXXX');

</script>

<!-- Event snippet for Room Booking conversion page

In your html page, add the snippet and call gtag_report_conversion when someone clicks on the chosen link or button. -->

<script>

function gtag_report_conversion(url, price, currency) {

  var callback = function () {

    if (typeof(url) != 'undefined') {

      window.location = url;

    }

  };

  gtag('event', 'conversion', {

      'send_to': 'AW-XXXXXXXX/Yr6SCP-KqrkBEKTlqdsC',

      'value': price,

      'currency': currency,

      'transaction_id': '',

      'event_callback': callback

  });

  return false;

}

</script>

 

MHS gives us 3 separte tracking codes to input in this script above. These codes should replace the XXXXXXXX in the script above. 

 


Booking Link to connect Channex to GHA

https://app.thebookingfactory.com/HOTELNAME/book?dateFrom=(CHECKIN_DATE)&nights=(LENGTH)#/choose-room
 *be careful to only change HOTELNAME to the slug for the property. 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article