Search
Clear search
Close search
Google apps
Main menu

Variable Definitions

The following table describes the variables used in the conversion tracking snippets. When adding the snippets to your booking confirmation site, set the values of the variables with code that inserts the actual booking details, as described in Setting up conversion tracking. This data is sent to Google when a user reaches the confirmation page so that your reports show accurate conversion data.

For convenience, the text that you replace with code for each variable is indicated in the snippet with $$value_to_replace$$.

In addition to the names and descriptions of each variable, the table also indicates which values are required in the Required? column:

  • All: All conversions must set the value of this variable.
  • bidding_strategy_name: Only conversions that use this bidding strategy require this variable.
  • Recommended: This variable is optional (but recommended) for all conversions.
Variable Name Required? Description/Formatting Instructions
hct_base_price Target ROAS Replace $$base_price$$ with the amount the user will pay for the entire stay, not including taxes and fees, in the currency specified by the hct_currency_code variable. Use a "." for decimal numbers. For example, "16.20".
hct_booking_xref Recommended Replace $$booking_xref$$ with a booking reference number for this conversion that you can use to correlate conversions reported by Hotel Ads with the booking data in your own system.

The value should be no longer than 64 characters, and should not contain "\", "=", or ";" characters.

This value, if set, must be encrypted or obfuscated so that Google does not receive customer-identifying information.

The actual value provided to your customer may not be transmitted to Google nor stored on Google servers in the clear as part of a conversion-tracking system. This is for the protection of all parties (the user, Google, and your booking system).

One way to generate an acceptable value for the booking reference number is to use a salted hash of the actual confirmation number.

hct_checkin_date
hct_checkout_date
Recommended Replace $$checkin_date$$ and $$checkout_date$$ with the dates on which the end-user checks in and checks out.

The format of the date is determined by the value of the hct_date_format variable. The default format is YYYY-MM-DD, where YYYY is the four-digit year, MM is the two-digit month, and DD is the two-digit day. For example, "2016-06-07".

You can convey the hct_checkin_date and hct_checkout_date variables in one of the following ways:

  1. Specify both dates using the hct_checkin_date and hct_checkout_date variables.
  2. Specify hct_checkin_date and hct_length_of_stay. Google will calculate the check-out date.
  3. Use hct_checkin_date to send both the check-in date and check-out date as a single variable.

    For example: hct_checkin_date = '20160607 | 20160615'

    The date string will be deconstructed into check-in and check-out dates and any intervening delimiter characters will be ignored.

hct_currency_code All Replace $$currency_code$$ with an ISO 4217 three-letter currency code representing the currency in which the booking was made.

The default is "USD".

The currency code applies to the hct_base_price and hct_total_price variables.

hct_date_format Recommended Replace $$date_format$$ with a format definition. This format is then used by the hct_checkin_date and hct_checkout_date variables. Choose from the following options:
  1. Format dates as YYYY-MM-DD (the default).
  2. Set hct_date_format to any standard strftime(3) notation.

    For example, %Y-%m-%d describes the format for "2016-06-15", with "-" as a delimiter.

You can use any delimiters you want; Google deconstructs the date string into the individual values and ignores delimiters. For example, set %Y/%m/%d to format the date as "2016/06/15".

Do not replace $$date_format$$ with "YYYY-MM-DD", as that is not valid strftime(3) notation.

hct_length_of_stay Recommended Replace $$length_of_stay$$ with the number of days in the booked itinerary. The value must be a whole number.
hct_partner_hotel_id Recommended Replace $$partner_hotel_id$$ with the property ID of the hotel for which you want to record conversion data. This ID must match the ID in your Hotel List Feed.
hct_total_price Recommended Replace $$total_price$$ with the amount that the user will pay for the entire stay, including taxes and fees, in the currency specified by the hct_currency_code variable. Use a "." for decimal numbers. For example, "16.20".
ord All* Replace $$random$$ with a random number that ensures the client does not use a cached snippet pixel.

Set this value to a random number generated by the booking engine, if possible. This guarantees that the browser always sends a fresh version of the image pixel request rather than displaying a cached version of a previous request.

If a random number cannot be generated for each booking, then hard-code in the value "1234567890".

* Required in the <nocode> JavaScript block or when you use <img> tag snippets.

Do not change the values of the following variables in the snippet:

  • google_conversion_id
  • google_conversion_language
  • google_conversion_format
  • google_conversion_color
  • google_conversion_label
  • google_custom_params
  • google_conversion_domain
  • hct_ver (Floodlight only)
Was this article helpful?
How can we improve it?