Search
Clear search
Close search
Google apps
Main menu
true

Manual Setup

This section describes how to manually set up conversion tracking. If possible, however, you should use the Conversion Tracking tool to perform this setup.

Choose the instructions for the appropriate version of the snippet depending on your website configuration:

The HTML snippets below contain a number of custom parameters that enable conversion tracking of bookings attributable to Hotel Ads.
 

All of these custom fields are optional. However, to maximize the benefit of your conversion tracking reports, you are encouraged to provide values for all data elements.

You must modify some sections of the code below to dynamically insert the values associated with a conversion. Values such as checkin_date are replaced with a custom parameter value. For example: hct_checkin_date="checkin_date" becomes hct_checkin_date="2014-04-12".

The general process for manually adding conversion tracking is:

  1. Get your partner ID from Google if you don't already know it.
  2. Determine which version of the snippet to use:
    • If you can edit the booking site landing pages, use the <img> tag.
    • You may also use the JavaScript snippet, but there have been instances of adverse interactions with other installed Google pixels when you use the Standard JavaScript snippet.
    • If you can edit the booking site landing pages but cannot include external JavaScript files, use the <img> tag.
    • If you use DoubleClick Floodlight, use this version.
  3. Modify the snippet, replacing text in red with your values.
  4. Paste the snippet between the <body></body> tags of the page you want to track.
  5. If there are other Google snippets already installed on the page (such as AdWords Conversion Tracking), position the Hotel Ads Conversion Tracking snippet after the others.
  6. Test your snippet with the Conversion Tracking tool.
  7. Ask Google to validate your installation after your development work is complete.

<img> tag (recommended)

Use an <img> tag if you can place the snippet directly into your website.

The instructions below are for installing a version of the Hotel Ads conversion tracking tag that is based on the HTML <img> tag. This version of the tag is recommended. The <img> based tag requires scripting a random number to prevent the browser from displaying a cached version of a previous image pixel request.

If you intend to deploy this tag as part of an existing tag manager (such as DoubleClick Floodlight), it is possible that the specific version of the tag on this page is not the best solution.

After modifying the HTML snippet, paste it between the <body></body> tags of the page you want to track. If there are other Google snippets already installed on the page (such as AdWords Conversion Tracking), position the Hotel Ads conversion tracking snippet after the others.

Use the Variable Definitions to determine which variables are required and how to format those variables.

Add the HTML code below to the web page that you want to track. In most cases, this will be the booking confirmation page.

HTML code for <img> version 

Replace the text in red below and add the HTML code below to web pages that you want to track. In most cases, this will be the booking confirmation page for each Point Of Sale you support.

<img height="1" width="1" border="0" alt=""
src="https://www.googletraveladservices.com/travel/clk/pagead/conversion/$$partner_id$$/?label=HPA&guid=ON&script=0&ord=$$random$$&data=hct_partner_hotel_id%3D$$partner_hotel_id$$%3Bhct_base_price%3D$$base_price$$%3Bhct_total_price%3D$$total_price$$%3Bhct_currency_code%3D$$currency_code$$%3Bhct_checkin_date%3D$$checkin_date$$%3Bhct_checkout_date%3D$$checkout_date$$%3Bhct_length_of_stay%3D$$length_of_stay$$%3Bhct_date_format%3D$$hct_date_format$$%3Bhct_booking_xref%3D$$booking_xref$$%3Bhct_ver%3D1.0.i"
/>

Standard JavaScript

This version of the tracking code does not require the booking confirmation page to generate a random number for cachebusting.  

After modifying the HTML snippet, paste it between the <body></body> tags of the page you want to track. If there are other Google snippets already installed on the page (such as AdWords Conversion Tracking), position the Hotel Ads Conversion Tracking snippet after the others.

Use the Variable Definitions to determine which variables are required and how to format those variables.

Add the HTML code below to web pages that you want to track. In most cases, this will be the booking confirmation page for each Point Of Sale you support.

HTML code for Javascript version

Replace the text in red below and add the HTML code below to web pages that you want to track. In most cases, this will be the booking confirmation page for each Point Of Sale you support.


<!-- Google Code for Hotel Ads Conversion Tracking -->
<script type="text/javascript">
  /* <![CDATA[ */
  var google_conversion_id = $$partner_id$$;
  var google_conversion_language = "en";
  var google_conversion_format = "3";
  var google_conversion_color = "ffffff";
  var google_conversion_label = "HPA";
  var google_custom_params = {
    hct_partner_hotel_id: '$$partner_hotel_id$$',
    hct_base_price: '$$base_price$$',
    hct_total_price: '$$total_price$$',
    hct_currency_code: '$$currency_code$$',
    hct_checkin_date: '$$checkin_date$$',
    hct_checkout_date: '$$checkout_date$$',
    hct_length_of_stay: '$$length_of_stay$$',
    hct_date_format: '$$date_format$$',
    hct_booking_xref: '$$booking_xref$$',
    hct_ver: "1.0.j"
  };
  var google_conversion_domain = "www.googletraveladservices.com/travel/clk";
  /* ]]> */
</script>

<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>

<noscript>
  <div style="display:inline;">
    <img height="1" width="1" style="border-style:none;" alt="" 
      src="https://www.googletraveladservices.com/travel/clk/pagead/
      conversion/$$partner_id$$/?label=HPA&guid=ON&script=0&ord=$$random$$
      &data=hct_partner_hotel_id%3D$$partner_hotel_id$$%3B
        hct_base_price%3D$$base_price$$%3B
        hct_total_price%3D$$total_price$$%3B
        hct_currency_code%3D$$currency_code$$%3B
        hct_checkin_date%3D$$checkin_date$$%3B
        hct_checkout_date%3D$$checkout_date$$%3B
        hct_length_of_stay%3D$$length_of_stay$$%3B
        hct_date_format%3D$$hct_date_format$$%3B
        hct_booking_xref%3D$$booking_xref$$%3B
        hct_ver%3D1.0.j"
      />
  </div>
</noscript>
<!-- End Google Code for Hotel Ads Conversion Tracking -->  

DoubleClick Floodlight

If you manage tracking snippets with DoubleClick Floodlight, use this version of the snippet.

After modifying the HTML snippet, add it to the Floodlight container tag for the page you want to track. If there are other Google snippets already installed for the page (such as AdWords Conversion Tracking), position the Hotel Ads Conversion Tracking snippet after the others, if possible.

Use the Variable Definitions to determine which variables are required and how to format those variables.

There are two versions of the tracking tag below: A JavaScript version and an <img> tag version. The <img> tag version still uses JavaScript, but is lighter weight in that it does not include any JavaScript downloaded from the server.

<img> conversion tracking tag

HTML for <img> version

Replace the text in red below and add the HTML code below to web pages that you want to track. In most cases, this will be the booking confirmation page for each Point Of Sale you support.


<script>
  var hct_partner_hotel_id = '$$partner_hotel_id$$';
  var hct_base_price = '$$base_price$$';
  var hct_total_price = '$$total_price$$';
  var hct_currency_code = '$$currency_code$$';
  var hct_checkin_date = '$$checkin_date$$';
  var hct_checkout_date = '$$checkout_date$$';
  var hct_length_of_stay = '$$length_of_stay$$';
  var hct_date_format = '$$date_format$$';
  var hct_booking_xref = '$$booking_xref$$';
  var axel = Math.random() + '';
  var num = axel * 1000000000000000000;
  document.write('
    <img height="1" width="1" style="border-style:none;" alt="" 
      src="https://www.googletraveladservices.com/travel/clk/pagead/
        conversion/$$partner_id$$/?label=HPA&guid=ON&script=0
        &ord='+num+'&data=hct_partner_hotel_id%3D'+hct_partner_hotel_id+'%3B
          hct_base_price%3D'+hct_base_price+'%3B
          hct_total_price%3D'+hct_total_price+'%3B
          hct_currency_code%3D'+hct_currency_code+'%3B
          hct_checkin_date%3D'+hct_checkin_date+'%3B
          hct_checkout_date%3D'+hct_checkout_date+'%3B
          hct_length_of_stay%3D'+hct_length_of_stay+'%3B
          hct_booking_xref%3D'+hct_booking_xref+'%3B
          hct_date_format%3D'+hct_date_format+'%3B
          hct_ver%3D1.0.j.f"
    />'
  ); // end write
</script>

JavaScript conversion tracking tag

HTML for JavaScript version 

Replace the text in red below and add the HTML code below to web pages that you want to track. In most cases, this will be the booking confirmation page for each Point Of Sale you support.


<!-- Google Code for Hotel Ads Conversion Tracking -->
<script type="text/javascript">
  var google_tag_params = {
    hct_partner_hotel_id: '$$partner_hotel_id$$',
    hct_base_price: '$$base_price$$',
    hct_total_price: '$$total_price$$',
    hct_currency_code: '$$currency_code$$',
    hct_checkin_date: '$$checkin_date$$',
    hct_checkout_date: '$$checkout_date$$',
    hct_length_of_stay: '$$length_of_stay$$',
    hct_date_format: '$$date_format$$',
    hct_booking_xref: '$$booking_xref$$',
    hct_ver: '1.0.j.f'
};
</script>

<script type="text/javascript" id="hpa_conversion_vars">
  /* <![CDATA[ */
  var google_conversion_id = $$partner_id$$;
  var google_conversion_language = "en";
  var google_conversion_format = "3";
  var google_conversion_color = "ffffff";
  var google_conversion_label = "HPA";
  var google_custom_params = window.google_tag_params;
  var google_conversion_domain = "www.googletraveladservices.com/travel/clk";
/* ]]> */
</script>

<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>

<noscript>
  <div style="display:inline;">
    <img height="1" width="1" style="border-style:none;" alt="" 
    src="https://www.googletraveladservices.com/travel/clk/pagead/
      conversion/$$partner_id$$/?label=HPA&guid=ON&script=0
      &data=hct_ver%3D1.0.j.f" />
  </div>
</noscript>
<!-- End Google Code for Hotel Ads Conversion Tracking -->  


If you have questions or need assistance, contact Google with the contact form.

Was this article helpful?
How can we improve it?