Search
Clear search
Close search
Google apps
Main menu

Conversion Tracking Tool

You can use the Conversion Tracking tool to set up your booking site to track users who click through an ad and eventually book a room. The tool also lets you view the status or health of your conversion tracking variables.

This section includes the following topics:

Setting up conversion tracking

The Conversion Tracking tool generates a snippet of code that you put on your booking confirmation page. The code executes when a user clicks from your ad through to your booking site. It calls out to the Google servers to log information about the end-user that books a room.

You should set up the conversion tracking code for each booking site that you have (which correspond to the number of Points of Sale you use). After setting up the code on your booking page, use the tool to verify that it is working properly, and then enable conversion tracking for your account.

Step 1: Set up your booking confirmation page

The first step in setting up conversion tracking is to add a code snippet to your booking confirmation page. You get this snippet from the Conversion Tracking tool. This is the hardest step, so please take great care in following the instructions and ensuring that your snippet's variables use the proper formatting.

To set up conversion tracking:

  1. Open the Hotel Ads Center.
  2. Select the Tools tab. Select Conversion Tracking in the left-hand navigation.

     

    The Conversion Tracking Setup view displays:

    The tool highlights Step 1 in the view.

    If you have already set up conversion tracking, the tool displays the Conversion Tracking Health view. For more information, see Troubleshooting conversion tracking.

  3. From the drop-down, select the type of snippet to add to your booking confirmation page:

     

    TIP: Google recommends that you use the HTML (<img>) snippet for conversion tracking.

    The following table describes the possible types of snippets:

    Snippet Type Description
    HTML Recommended Use this snippet if you can edit your booking confirmation page but cannot reference external JavaScript from it.

     

    The HTML snippet takes the form of a single-pixel image. The variables that the snippet uses are defined as query string parameters in the <img> tag's src attribute. This snippet does not rely on JavaScript.

    JavaScript Use this snippet if you can edit your booking confirmation page and reference external JavaScript files from it.

     

    This snippet includes a JavaScript and <noscript> block to support all clients, regardless of whether JavaScript is enabled or not.

    NOTE: Do not use this snippet if you also use AdWords for conversion tracking. Use the HTML snippet instead.
    Floodlight - JavaScript Use this snippet if you use the DoubleClick Floodlight tag manager and can reference external JavaScript files from the booking confirmation page.
    Floodlight - img Use this snippet if you use the DoubleClick Floodlight tag manager but cannot reference external JavaScript files from the booking confirmation page.
  4. Copy the selected snippet's text to your booking confirmation page and edit it:
    1. Set the value of each variable by replacing each $$value_to_replace$$ in the snippet with code that dynamically inserts the conversion's booking details. For an example that uses Java Server Pages (JSPs), see Example Snippet.
    2. Use the Variable Definitions to get the property formatting for each variable.

    You are not required to set the values for every variable, but the more you set, the more informative the Hotel Ads reports will be.

    NOTE: In some cases, the bidding strategy that you use requires one or more variables to be set. The requirements are noted in Variable Definitions.
  5. After adding the snippet code to your booking site, return to the Conversion Tracking tool.
  6. Click the Next button in Step 1 in the UI. In Step 2, you will verify that the snippet code is working.

Step 2: Verify your snippet

After you add the code snippet to your booking page, verify that your booking site can connect to Google.

To verify that your snippet is working:

  1. Open the Hotel Ads Center.
  2. Select the Tools tab. Select Conversion Tracking in the left-hand navigation.
  3. Click the Next button in this step to proceed to Step 2 in the UI.

     

    If you have already set up conversion tracking, the tool displays the health status over the last 8 days for your snippet and the tracking variables, as the following example shows:

    INITIAL SETUP: If you are checking your status for the first time, you may need to wait up to 15 minutes before continuing to the next step.

  4. Look at the Conversion Tracking Health Status. The "pill" provides an overall assessment of your tracking status. The label "Last joined click received [date]" indicates when the last time a click led to a conversion. A joined click occurs when the conversion ping we received was matched up against an actual user click on the hotel ad in Google.

     

    INITIAL SETUP: If you are checking your status for the first time, and have waited at least 15 minutes, you should see an orange pill. This confirms that your tracking data is at least somewhat working. If the pill is red, your booking confirmation page is not contacting Google successfully. See Troubleshooting.

    If conversion tracking is already set up, the color of the pill should be green. If it is orange or red, see Troubleshooting.

  5. Look at each Tracking Variable's status. The tool checks each tracking variable to ensure that it is present (if required) and formatted properly. Each one should be labelled "OK". If not, then see Troubleshooting.

     

    The list includes all variables, regardless of whether you set them or not, with the exception of the ord ($$random$$) variable.

    INITIAL SETUP: If you are checking your status for the first time, the data for individual tracking variables is not used.

If you are satisfied that the snippet is working, proceed to Step 3 to fully enable it for your Hotel Ads account.

Step 3: Enable conversion tracking

After verifying that your snippet is working, you must enable conversion tracking in the tool. This is the final step in the process.

  1. From Step 2, select the following checkbox to verify that you are not sending sensitive data to Google in clear text:

  2. Click the Looks like it's working, turn on my conversion statistics button to proceed to Step 3 in the UI:

  3. Click the Finished button.

Google will verify your setup. This can take up to 24 hours.

Your booking confirmation page should replace the variables with the actual booking details and the snippet will call Google to record the conversion.

If you have any questions, please contact your support team at travelads-partners@google.com.

Troubleshooting

After conversion tracking is set up, you can use the Conversion Tracking tool to check its overall status as well as the status of each tracking variable.

To display the current status:

  1. Open the Hotel Ads Center.
  2. Select the Tools tab. Select Conversion Tracking in the left-hand navigation.

     

    If you have already set up conversion tracking, the Conversion Tracking Health view displays:

    This view displays the status of all conversion tracking variables and an overall health status of the booking site's connection.

    If you have not yet set up conversion tracking, the tool displays the Conversion Tracking Setup view. For more information, see Setting up conversion tracking.

  3. You should see at least two domains in the Conversion Tracking Health Status: the partner domain and Referrer Unknown. There are multiple reasons we don't get a referring website that we can't avoid. They include: browser settings, a few cases of HTTP Secure connections, use of bookmarks, etc. If we can't recognize the domain name in the referring website, it is tracked under Referrer Unknown.
  4. Review the list of tracking variables and their statuses. The list includes all variables, regardless of whether you set them or not, with the exception of the ord ($$random$$) variable.

     

    In the example above, most most tracking variables are OK, with the following exceptions.

There are two components to the conversion tracking health status, described in the sections that follow.

Overall status

The tool provides an overall indicator of the status of your conversion tracking variables and indicates if your server and Google's can connect.

The color of the box indicates the relative health of your conversion tracking snippet:

Green indicates that all tracking variables are at least 75% successful.

 

INITIAL SETUP: If you are verifying your snippet for the first time, you should see an orange pill for success or a red pill for failure.

Orange indicates that at least one tracking variable is under 75% health but there is at least one ping in the last 8 days.

 

INITIAL SETUP: If you are verifying your snippet for the first time, an orange pill indicates success.

Red indicates that no pings have been received in the last 8 days.

 

INITIAL SETUP: If you are verifying your snippet for the first time, a red pill indicates failure.

Common causes of failure include:

  • Your server cannot connect to Google: Ensure that your firewall settings allow outbound calls.
  • Syntax errors in your snippet code: Ensure that your code uses the correct variable definitions.
  • If you use AdWords' tracking snippet, then you cannot use the JavaScript snippet for Hotel Ads: Use the recommended HTML (<img>) snippet instead.

Individual tracking variable status

A variable can fail in a variety of situations, including changes in the booking confirmation page or if you start using new bidding strategy.

TIP: When variables fail, check the Variable Definitions to ensure that your code conforms to the requirements.

The following list describes some common issues that might cause failures with the tracking variables:

  • Optional variable not found: The tool warns you when optional variables are not set. This is for informational purposes only, but you should keep in mind that the more variables you set, the more meaningful the reports will be. As a result, set the values of as many variables as possible on your booking page.
  • Bad format defined: Date-related variables (hct_checkin_date and hct_checkout_date) rely on the format you define with the hct_date_format variable. If those variables do not follow the format, then errors can occur. To help troubleshoot this, try using the default date format (%Y-%m-%d), which resolves to YYYY-MM-DD. For example, "2016-06-07". Be sure that you carefully follow the syntax described in Variable Definitions.
    NOTE: Do not set the value of hct_date_format to "YYYY-MM-DD". That is not a valid format.
  • Required variables not found: Required variables must be set. The Variable Definitions specifies which variables are required.
  • Bidding strategy requirements: Some variables are required, depending on your account settings. Some bidding strategies require that certain variables be set. For example, to enable conversion tracking with the Target ROAS bidding strategy, you must set hct_currency_code and hct_base_price. The Variable Definitions specifies which bidding strategies require which variables.
  • Booking reference not encrypted: If you include the booking reference number (hct_booking_xref in the snippet), contact Google to ensure that this data is being encrypted.
  • Cached values: The <img> snippet might be using a cached value. Be sure to set the value of the ord variable in your snippet to a random number for each booking.

Example Snippet

The following example snippet shows a JavaScript snippet that uses Java Server Pages (JSP) syntax to replace each variable with values extracted from a query string. This is just an example: your implementation will differ, depending on the technology stack that your booking site uses.

Code that extracts values for the snippet are highlighted in bold.


...
<!-- Google Code for Hotel Ads Conversion Tracking -->
<script type="text/javascript">
  /* <![CDATA[ */
  var google_conversion_id = {0};
  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: '<%= request.getParameter("hotelid") %>',
    hct_base_price: '<%= request.getParameter("base") %>',
    hct_total_price: '<%= request.getParameter("total") %>',
    hct_currency_code: '<%= request.getParameter("curr") %>',
    hct_checkin_date: '<%= request.getParameter("checkin") %>',
    hct_checkout_date: '<%= request.getParameter("checkout") %>',
    hct_length_of_stay: '<%= request.getParameter("los") %>',
    hct_date_format: '<%= request.getParameter("dateformat") %>',
    hct_booking_xref: '<%= request.getParameter("bookingcode") %>',
    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/{0}/?label=HPA&guid=ON&script=0&ord=<%= (int) (Math.random() * 10) %>
      &data=hct_partner_hotel_id%3D<%= request.getParameter("hotelid") %>%3B
        hct_base_price%3D<%= request.getParameter("base") %>%3B
        hct_total_price%3D<%= request.getParameter("total") %>%3B
        hct_currency_code%3D<%= request.getParameter("curr") %>%3B
        hct_checkin_date%3D<%= request.getParameter("checkin") %>%3B
        hct_checkout_date%3D<%= request.getParameter("checkout") %>%3B
        hct_length_of_stay%3D<%= request.getParameter("los") %>%3B
        hct_date_format%3D<%= request.getParameter("dateformat") %>%3B
        hct_booking_xref%3D<%= request.getParameter("bookingcode") %>%3B
        hct_ver%3D1.0.j"
      >
    </img>
  </div>
</noscript>
<!-- End Google Code for Hotel Ads Conversion Tracking -->
...
Was this article helpful?
How can we improve it?