Hotel Ads and free booking links include links to landing pages where the users can book rooms. You can define how Google constructs the link to include all additional information about the user and their itinerary. For example, you can include information such as the hotel ID, language, currency codes, and check-in dates in the URL.
Overview
You define the landing page URL in the landing pages file. When the ad or free booking link is displayed, dynamic information in the URL is replaced with actual values. To add dynamic values to your landing page URLs, use the following syntax:
<URL>https:// partner_url
? param_id
=( variable_name
)</URL>
The following examples shows a URL that uses Google's variable names instead of actual hotel ID and itinerary:
Example 1
<URL>https://www.partnerdomain.com?hotelID= (PARTNER-HOTEL-ID)
&checkinDay= (CHECKINDAY)&checkinMonth= (CHECKINMONTH)
&checkinYear= (CHECKINYEAR)&nights= (LENGTH)</URL>
Example 2
<URL>https://www.partnerdomain.com/hotel/ (PARTNER-HOTEL-ID)
&checkinDay= (CHECKINDAY)&checkinMonth= (CHECKINMONTH)
&checkinYear= (CHECKINYEAR)&nights= (LENGTH)</URL>
When the landing page link is constructed for search results page, Google replaces the variables with the actual values to ensure the URL includes the dynamic information. For example, if the user books a room for 6 nights starting on 5/23/2023 for hotel #42, Google renders the previous link as the following:
https://www.partnerdomain.com?hotelID=42&checkinDay=23&checkinMonth=05&checkinYear=2023&nights=6
Values that Google assigns to the variables in the query string depends on the corresponding data in your Hotel Price Feed, Hotel List Feed and user settings.
For example,the value of LENGTH
variable is assigned to <Nights>
element
from the related itinerary's price feed. Similarly, the value of PARTNER-HOTEL-ID
variable is defined in the <id>
element from the Hotel List
Feed that matched the user's search criteria.
Some variables are subsets of the price feed elements. For example, the CHECKINDAY
, CHECKINMONTH
, and CHECKINYEAR
variables are extracted from the
single <Checkin>
element in the price feed. Other variables are calculated
based on the user's locale and other client settings.
For more information about the sources of variable values, refer to Pricing overview and Hotel List .
URL variables
The following table describes the available variables that you can use to construct your landing page URL:
36
.<Checkin>
element
of the Hotel Price Feed. For example, 20
.Monday
to Sunday
,
when the check-in takes place, in the hotel's timezone. For example, Tuesday
.<Checkin>
element of the Hotel Price Feed. For example, 05
.<Checkin>
element of the Hotel Price Feed. For example, 2023
.<Nights>
and <Checkin>
elements of the Hotel Price Feed. For
example, 26
.<Nights>
and <Checkin>
elements of the Hotel Price Feed. For
example, 05
.<Nights>
and <Checkin>
elements of the Hotel Price Feed. For
example, 2023
.<Child "age">
elements of the price feed.
This variable must be used in conjunction with a FOR-EACH-CHILD-AGE
conditional block.FOR-EACH-CHILD-AGE
conditional block.-
hotel
: The user clicked on the listing for a standard room rate. -
room
: The user clicked on the listing for a Room Bundle.
<Result>
element with 200 characters limit per
custom field. For more information, refer to Overview
of Transaction Messages
. Custom fields are not available when using ARI
. CUSTOM
variables are listed only when you send the prices
in the Transaction message. Important:
Contact your Technical Account Manager (TAM) if you want
to use CUSTOM
variables.
-
default
: The user clicked on a hotel ad or free booking link where the default dates were used. -
selected
: The user clicked on a hotel ad or free booking link with the dates set.
-
bl
: Paid Booking Links -
tpa
: Travel Promotions Ads -
tfsa
: Travel Feeds in Search Ads -
pm
: Performance Max or Performance Max for Travel Goals campaigns.
Note:If the click originated from Google Search rather than Google Ads, this parameter is empty
-
localuniversal
: The user found the hotel booking link throughgoogle.com
search. -
mapresults
: The user found the hotel booking link throughmaps.google.com
. -
verification
: Google uses this value when performing automated data quality tests on your site. You are not billed for these queries. Google Analytics can use this parameter and its value for identifying Hotel Ads automated verification traffic. -
unknown
: The user found the ad or free booking link through an undetermined source.
<Nights>
element in the Hotel Price Feed. For
example, 3
.If you use ARI
Rate modifications
, the value of this variable is the id
attribute of rate modification message. If
multiple rate modifications are applied, it is a comma-separated list of
modification IDs in an arbitrary order.
NUM-CHILDREN
or FOR-EACH-CHILD-AGE
condition)
NUM-CHILDREN
, FOR-EACH-CHILD-AGE
, or both.NUM-CHILDREN
, FOR-EACH-CHILD-AGE
, or both are required to successfully
participate in itineraries with child occupants.NUM-ADULTS
and NUM-CHILDREN
values. To
maximize participation, it is strongly recommended to utilize both NUM-ADULTS
and NUM-CHILDREN
instead.<PackageID>
element within a <Result>
block. For a Room Bundle, the package ID is the value of the <PackageID>
element within the <RoomBundle>
or <PackageData>
blocks
of the Transaction message.<Baserate>
element's currency
attribute
in the Hotel Price Feed. For example, USD
or CAD
.<id>
element in the Hotel List Feed.<RoomID>
element within the <Result>
block. For a Room Bundle, the room ID is the value assigned to the <RoomID>
element within the <RoomBundle>
or <RoomData>
blocks
in the Transaction message.commission
, or Google's assigned IATA number (for example,
"01234567"), if you use a commissions collection agency. To change the
formatting of your IATA number or predefined string, contact your
Technical Account Manager (TAM).PRICE-DISPLAYED-TAX
is the value of the <Tax>
element in the Hotel Price Feed. For example,
"3.14".PRICE-DISPLAYED-TOTAL
is the
sum of the <Baserate>
, <Tax>
, and <OtherFees>
elements from the Hotel Price Feed.
For example, "152.13".If you use ARI
promotions
, the value of this variable is assigned to the id
attribute of the applied <Promotion>
. If
multiple promotions are applied, it is a comma-separated list of
promotion IDs in an arbitrary order.
If you use rate rules
, the value of this variable is assigned to the PromoCode
element if the corresponding rate rule is applied.
<RatePlanID>
element in a
price feed's <RoomBundle>
block. The <RatePlanID>
represents the unique identifier
for a room and package data combination. For more
information, see Room Bundles
.rate_rule_id
attribute within a
price feed's <Rate>
block. For more information,
refer to Conditional Rates
. Note: Only conditional rates or private rates that are not hidden are shown.
US
or FR
.USER-CURRENCY
variable is
inferred from the user's client settings. For example, USD
or CAD
.USER-DEVICE
can
be one of the following: -
mobile
-
tablet
-
desktop
-
unknown
The value of the USER-DEVICE
variable is inferred from the
user's client settings.
USER-LANGUAGE
variable is inferred from the user's client settings. For example, en
or fr
.true
if the link was generated
by Google for testing or automated validation, otherwise it is false
.Conditional logic in URLs
You can use special directives in the <URL>
element of a landing pages file to
conditionally build endpoints.
The conditional logic supports the following statements:
-
if_statement : If
true
, then the values that follow this condition are inserted into the URL, otherwise the values following theELSE
directive are inserted. -
for_statement : Creates a FOR loop condition that iterates on the number of values provided.
IF and FOR statements include the following:
Condition | Recommended/optional | Description |
---|---|---|
IF-AD-CLICK
(Hotel Ads only)
|
Optional | Resolves to true
if the user click originated from an ad.
Resolves to false
if the user click originated from a free
booking link. |
IF-CLICK-TYPE-HOTEL
|
Optional | Resolves to true
if the user clicked on a listing for a
hotel, otherwise resolves to false
. |
IF-CLICK-TYPE-ROOM
|
Optional | Resolves to true
if the
user clicked on a listing for a Room Bundle
, otherwise resolves to false
. |
IF-CLOSE-RATE-RULE-IDS
|
Optional | Resolves to true
if one or more conditional rates were
unavailable because the user was ineligible, otherwise resolves to false
. By default, it is true
if a private rate
UI treatment was shown to the user. |
IF-DEFAULT-RATE
|
Optional | Resolves to true
if the user clicked on a hotel listing
where default dates were used, otherwise resolves to false
. |
IF-HOTEL-CAMPAIGN
|
Optional | Resolves to true
if the user click originated from a
hotel campaign, otherwise resolves to false
. This
distinction is helpful for partners that have multiple campaign types
present in Google Ads to allocate attribution. |
IF-MODIFICATION-IDS
|
Optional | Resolves to true
if the user clicked on a rate which is
modified by an ARI rate modification; otherwise resolves to false
. |
(Hotel Ads only)
|
Recommended (if you use pay-per-stay Google Ads campaigns) | Deprecated:Resolves to true
for hotels
in the Pay-Per-Stay (PPS) commissions program otherwise resolves to false
. |
IF-PROMO-CODE
|
Optional | Resolves to true
if the user clicked on a rate which is
based on an ARI promotion or a rate rule with a given PromoCode
;
otherwise resolves to false
. |
IF-PROMOTED
(Hotel Ads only)
|
Recommended (if you use Promoted hotels) | Resolves to true
if the user clicked on a Property
Promotion Ad, otherwise resolves to false
. |
IF-RATE-RULE-ID
|
Optional | Resolves to true
if the user selected a conditional rate
, otherwise resolves to false
. |
IF-USER-LIST-ID
(defined in Google Ads)
|
Optional | Resolves to true
if the user is a member of a Google Ads
customer list ID you specified when setting bid multipliers for audience
lists, otherwise resolves to false
. |
IF-VERIFICATION
|
Optional | Resolves to true
if the link was generated by Google for
testing or automated validation, otherwise resolves to false
. |
ELSE
|
Recommended (if you use any conditional IF statements) | If the previous condition is not met, then the values that follow this condition are inserted into the URL. |
END-IF
|
Optional (required if you have any IF conditional statements) | Ends the IF
statement conditional block. |
FOR-EACH-CHILD-AGE
|
Optional (required for child occupancy pricing) | Executes one time for each <Child "age">
element in the price feed. For
example, if the <OccupancyDetails>
include the two
elements <Child age="17">
and <Child age=
"17">
, then the directive executes two times. |
END-FOR-EACH
|
Optional (required if using FOR-EACH block) | Ends the FOR-EACH
statement conditional block. |
IF-AD-CLICK example
You can construct a conditional block that checks if the user clicked an ad or free booking link to redirect to your landing page.
The following example uses this directive in a landing page file:
<URL>https://partner.com?hid=(PARTNER-HOTEL-ID) (IF-AD-CLICK)&adType=1 (ELSE)&adType=0 (ENDIF)</URL>
In this example, if the user did not click an ad, the result is the following URL:
https://www.partner.com?hid=123&adType=0
If the user clicked the ad, the result is the following URL:
https://www.partner.com?hid=123&adType=1
IF-CLICK-TYPE-HOTEL example
You can construct a conditional block that checks if the user selected a hotel
without an explicit Room Bundle. The value of <RatePlanID>
element in the <Room Bundle>
block of a Transaction message will be set to the implicitly
associated room bundle price that the user had selected.
The following example uses this directive in a landing pages file:
<URL>https://partner.com/ (IF-CLICK-TYPE-HOTEL)landing (ELSE)landing_room (ENDIF)?hid=(PARTNER-HOTEL-ID)</URL>
In this example, if the user selected a Room Bundle, the result is the following URL:
https://partner.com/landing_room?hid=123
If the user didn't select a Room Bundle, the result is the following URL:
https://partner.com/landing?hid=123
IF-CLICK-TYPE-ROOM example
You can construct a conditional block that checks if the user selected a Room Bundle.
The following example uses this directive in a landing pages file:
<URL>https://partner.com/ (IF-CLICK-TYPE-ROOM)landing_room (ELSE)landing (ENDIF)?hid=(PARTNER-HOTEL-ID)</URL>
In this example, if the user didn't select a Room Bundle, the result is the following URL:
https://partner.com/landing?hid=123
If the user selected a Room Bundle, the result is the following URL:
https://partner.com/landing_room?hid=123
IF-DEFAULT-DATE example
Use the IF-DEFAULT-DATE
conditional statement to set a non-date parameter that
your website can then use to trigger custom behavior if the user didn't select
a date.
The following example checks if the default date was used:
<URL>https://partner.com?hotelID=(PARTNER-HOTEL-ID)&checkinDay=(CHECKINDAY)&checkinMonth=(CHECKINMONTH)&checkinYear=(CHECKINYEAR)&nights=(LENGTH)<strong>(IF-DEFAULT-DATE)</strong>&popup_datepicker=true (ELSE)&popup_datepicker=false (ENDIF)</URL>
In this example, if the user didn't select a date, the result might be similar to the following URL that shows default date selections:
https://partner.com?hotelID=123&checkinDay=23&checkinMonth=05&checkinYear=2023&nights=1&popup_datepicker=true
If the user selected a date, the result might be similar to the following URL, depending on the itinerary they selected:
https://partner.com?hotelID=123&checkinDay=23&checkinMonth=05&checkinYear=2023&nights=2&popup_datepicker=false
IF-HOTEL-CAMPAIGN example (Hotel ads and free booking links clicks)
You can construct a conditional block that checks if the user clicked an ad that originated from a hotel campaign.
The following example uses this directive in a landing page file:
<URL>https://partner.com?hotelID=(PARTNER-HOTEL-ID) (IF-HOTEL-CAMPAIGN)&hotel_campaign=(CAMPAIGN-ID) (ELSE)utm_campaign=(CAMPAIGN-ID) (ENDIF)</URL>
In this example, if the user clicks on a hotel campaign URL, the result is the following URL:
https://www.partner.com?hotelID=123&hotel_campaign=12345678
If the click is not on a hotel campaign URL (e.g. regular search campaign), the result is the following URL:
https://www.partner.com?hotelID=123&utm_campaign=87654321
This is useful when you want to distinguish the traffic of hotel campaign clicks from any other clicks.
Blank CAMPAIGN-IDs with FBL clicks
If the click is from a free booking link, then IF-HOTEL-CAMPAIGN
returns TRUE
and CAMPAIGN-ID
value is set to blank as shown in the following URL:
https://www.partner.com?hotelID=123&hotel_campaign=
You can use IF-AD-CLICK
conditional statement to prevent blank campaign ID as
shown in the following example:
<URL>https://partner.com?hotelID=(PARTNER-HOTEL-ID) (IF-HOTEL-CAMPAIGN)(IF-AD-CLICK)&hotel_campaign=(CAMPAIGN-ID) (ELSE)&FreeBookingLink (ENDIF)(ELSE)utm_campaign=(CAMPAIGN-ID) (ENDIF)</URL>
IF-PROMOTED example (Hotel Ads only)
You can construct a conditional block that checks if the user clicked on a Property Promotion Ad.
The following example uses this directive in a landing pages file:
<URL>https://partner.com/ (IF-PROMOTED)1 (ELSE)0 (ENDIF)?hid=(PARTNER-HOTEL-ID)</URL>
In this example, if the user selected a Property Promotion Ad, the result is the following URL:
https://partner.com/1?hid=123
If the user didn't select a Property Promotion Ad, the result is the following URL:
https://partner.com/0?hid=123
IF-RATE-RULE-ID example
You can construct a conditional block that checks if the user selected a
conditional rate and if that is the case then the value of the <RateRuleID>
element in the <Rate>
block of the transaction message is used.
The following example uses this directive in a landing pages file:
<URL>https://partner.com?hid=(PARTNER-HOTEL-ID) (IF-RATE-RULE-ID)&customerType=42 (ELSE)(ENDIF)</URL>
In this example, if the user did not select a conditional rate, the result is the following URL:
https://www.partner.com?hid=123
If the user selected a conditional rate, the result is the following URL:
https://www.partner.com?hid=123&customerType=42
IF-USER-LIST-ID example (defined in Google Ads)
If you set bid multipliers for audience lists in a hotel campaign in Google Ads,
you can use IF-USER-LIST-ID
in conjunction with USER-LIST-ID
to set a
parameter on your website for a customer who belongs to a certain Google Ads
audience list. You may want to do so for tracking purposes or to customize your
website for members of audience lists.
<URL>https://partner.com/?hid=(PARTNER-HOTEL-ID) (IF-USER-LIST-ID)&audience_list= (USER-LIST-ID)(ELSE)(ENDIF)</URL>
In this example, if the user wasn't a member of an audience list, the result is the following URL:
https://www.partner.com?hid=123
If the user was a member of the audience list 12345678
, the result is
the following URL:
https://www.partner.com?hid=123&audience_list=12345678
IF-VERIFICATION example
If you need to check whether Google generated the URL for testing or automated
validation, you can use IF-VERIFICATION
.
<URL>https://partner.com/?hid=(PARTNER-HOTEL-ID) (IF-VERIFICATION)&isgoogle=true (ENDIF)</URL>
In this example, if Google didn't generate the URL for testing or validation, the result is the following URL:
https://www.partner.com?hid=123
If Google generated the URL for testing or validation, the result is the following URL:
https://www.partner.com?hid=123&isgoogle=true
FOR-EACH-CHILD-AGE example
You can construct a conditional block that populates the maximum age of each child occupant, as specified in the Hotel Price Feed.
The following example uses this directive in a landing pages file:
<URL>https://partner.com?adults=(NUM-ADULTS)&children=(NUM-CHILDREN) (FOR-EACH-CHILD-AGE)&age=(CHILD-INDEX)_(CHILD-AGE) (END-FOR-EACH)&hid=(PARTNER-HOTEL-ID)&</URL>
In this example, if the itinerary had 2 adults and 2 children with ages 0 and 17 respectively, the result is the following URL:
https://www.partner.com?adults=2&children=2&age=0_0age=1_17&hid=123
If the itinerary had 2 adults and 0 children then the result is the following URL:
https://www.partner.com?adults=2&children=0&hid=123
General rules when building URLs
All variables are optional. You are not required to insert any variables in your landing page URL. However, using variables to pass itinerary and user information generally creates a better experience for the user and aids you in conforming to Google's policies.
The following general rules apply when defining constructed URLs in a landing pages file:
-
All variables are surrounded with open and close parentheses.
-
Query string parameters must be separated by an ampersand ("&") in the final output. Because the ampersand is a special character in XML and the landing pages file format is XML . Therefore, you must use the encoded entity "&" in its place. The final output renders an actual "&" character. For example:
<!-- Do this: --> <URL>https://www.partnerdomain.com?hotelID=(PARTNER-HOTEL-ID) &nights=(LENGTH)</URL> <!-- Do NOT do this: --> <URL>https://www.partnerdomain.com?hotelID=(PARTNER-HOTEL-ID) &nights=(LENGTH)</URL>
You must also URL-encode special characters that you might include in the landing page URL. For example:
- space (" "): Replace space characters with "%20;" in the
<URL>
element - forward slash ("/"): Replace forward slashes with "%2F;" in the
<URL>
element
Not all non-alphabetical characters must be URL encoded. For example, hyphens ("-") doesn't need to be URL encoded. For a list of common characters that must be URL encoded, consult URL Encoding .
- space (" "): Replace space characters with "%20;" in the
-
Values for a single parameter can be constructed from multiple variables. The following example constructs a single parameter,
checkinDate
, from theCHECKINDAY
,CHECKINMONTH
, andCHECKINYEAR
variables:<URL>https://www.partnerdomain.com?checkinDate=(CHECKINDAY)%2F;(CHECKINMONTH)%2F;(CHECKINYEAR)</URL>
This example results in a URL that might look like the following:
https://www.partnerdomain.com?checkinDate=7/23/1971
-
You can use any ID for the name of the query string parameters. Your server processes these values. However, the values that you pass are limited to the list of available variables .
-
You can use up to five custom variables in addition to the list of available variables.