条件式费率是一种费率规则,可让您根据用户的设备、国家/地区或用户是否已登录 Google 等条件,为行程提供不同的费率。
如果您为行程或客房套餐设置了多个公开费率或条件式费率,用户会看到最低费率。Google 始终会为用户选择符合条件的最低房价。
概览
条件式费率会显示在标准定价广告位中,并且仅向搜索内容符合关联条件式费率条件的用户显示。这些条件可以基于以下因素:
如需启用条件式费率,请修改以下内容:
费率规则 XML 文件:定义应用条件式费率的条件。
价格 Feed:在交易消息中使用
<Rate>
元素设置费率。着陆页文件:向您的深层链接添加费率规则专用值。
设备专用条件式费率
设备专用房价是指仅在特定设备(例如移动设备、平板电脑或桌面设备)上显示且可供用户预订的酒店房价。费率由 Google 的合作伙伴提供,最终用户可以在合作伙伴的网站上查看和预订相同的设备专用费率。
针对特定国家/地区的条件式费率
特定国家/地区的房价是指仅向搜索特定国家/地区酒店的用户显示且可供这些用户预订的酒店房价。Google 会使用最终用户的 IP 地址确定国家/地区。费率由 Google 的合作伙伴提供,最终用户可以在合作伙伴自己的针对特定国家/地区的网站上查看和预订相同的针对特定国家/地区的费率。
特定于语言的条件式费率
只有在 Google 中使用特定语言设置搜索酒店的用户才能看到因语言而异的房价。使用 <LanguageCode>
元素定义特定于语言的条件。
包含上下文的查询请求消息中未指定语言。因此,如果您在费率规则中指定了 <LanguageCode>
,则“With Context”响应应包含所有相关的语言专用费率。
经过下采样的条件式费率
经过下采样的条件式费率仅向所有符合条件的用户中的随机部分用户显示。采样率使用 <MaxUsersPercent>
元素定义,并使用以下公式计算:
MaxUsersPercent = (number of users selected to view rate)/(total eligible users)
已登录状态下的条件式费率
只有使用 Google 账号登录的用户才能看到已登录用户的比例。Google 的合作伙伴提供房价,用户可以在合作伙伴自己的网站上查看和预订房价。已登录的费率是使用 <UserSignedIn>
元素定义的。
由于 Google 始终会选择符合条件的最低费率,因此如果条件式费率高于在 <Result>
级别设置的价格,系统绝不会选择条件式费率。为避免这种情况,请在 <Result>
级别移除费率,并对所有费率进行条件限定。或者,您也可以咨询您的技术支持客户经理,了解如何针对在 <Result>
级别设置的价格使用默认费率规则。
创建费率规则 XML 文件
条件式费率的费率规则是使用费率规则 XML 文件定义的。如需了解详情,请参阅费率规则 XML 参考。
更新价格 Feed
您可以使用交易消息中的元素设置基于条件的费率。
<Rate>
元素还可用作 <RoomBundle>
或 <Result>
元素中 <Rates>
的多个子元素。如需将其用作条件式费率,您必须将 rate_rule_id
属性的值设置为与您在费率规则 XML 文件中定义的费率规则 ID 相匹配。
如果您没有默认的公开双人入住费率,请将 <Result>
消息的 <Baserate>
子元素设置为 -1
。在这种情况下,发送给 Google 的任何基于条件的 <Rates>
都将被视为有效。
示例
基准 + 基于条件
以下示例展示了一个包含基准费率和条件式费率的交易消息:
<?xml version="1.0" encoding="UTF-8" ?>
<Transaction timestamp="2023-05-18T16:20:00-04:00" id="42">
<Result>
<Property>1234</Property>
<Checkin>2023-04-10</Checkin>
<Nights>1</Nights>
<Baserate currency="USD">200.00</Baserate>
<Tax currency="USD">20.00</Tax>
<OtherFees currency="USD">1.00</OtherFees>
<Rates>
<!-- The rate_rule_id is required when using conditional rates -->
<Rate rate_rule_id="mobile">
<!-- Override base rate and taxes for conditional rates -->
<Baserate currency="USD">180.00</Baserate>
<Tax currency="USD">18.00</Tax>
</Rate>
</Rates>
</Result>
</Transaction>
RoomBundle 单个房间
以下示例展示了一个包含<RoomBundle>
下的单个费率的交易消息:
<?xml version="1.0" encoding="UTF-8" ?>
<Transaction timestamp="2023-05-18T16:20:00-04:00" id="42">
<Result>
<Property>1234</Property>
<Checkin>2023-04-10</Checkin>
<Nights>2</Nights>
<Baserate currency="USD">300.00</Baserate>
<Tax currency="USD">30.00</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<RoomBundle>
<RoomID>single</RoomID>
<Baserate currency="USD">300.00</Baserate>
<Tax currency="USD">30.00</Tax>
<OtherFees currency="USD">2.00</OtherFees>
</RoomBundle>
<RoomBundle>
<RoomID>3</RoomID> <!-- Links to data in metadata -->
<RatePlanID>basic</RatePlanID>
<Baserate currency="USD">275.00</Baserate>
<Tax currency="USD">27.50</Tax>
<ChargeCurrency>web</ChargeCurrency>
<BreakfastIncluded>1</BreakfastIncluded>
<Rates>
<Rate rate_rule_id="mobile">
<Baserate currency="USD">269.00</Baserate>
<Tax currency="USD">2.69</Tax>
<OtherFees currency="USD">1.00</OtherFees>
</Rates>
</Rates>
</RoomBundle>
</Result>
</Transaction>
RoomBundle 多个
以下示例展示了一个包含<RoomBundle>
下的多个费率的交易消息:
<?xml version="1.0" encoding="UTF-8" ?>
<Transaction timestamp="2023-05-18T16:20:00-04:00" id="42">
<Result>
<Property>1234</Property>
<Checkin>2023-04-10</Checkin>
<Nights>2</Nights>
<!-- When Google receives new room bundle information for an itinerary, all
previous room bundle pricing is dropped from Google's cache. Thus, if you
want to delete a specific room bundle from Google's cache, you may do so
by simply not providing that specific room bundle in subsequent transaction
messages. -->
<RoomBundle>
...
<!-- RoomID is required, PackageID is recommended. -->
<RoomID>5</RoomID>
<PackageID>ABC</PackageID>
<!-- Baserate is required. -->
<Baserate currency="USD">275.00</Baserate>
<Tax currency="USD">27.50</Tax>
<OtherFees currency="USD">2.00</OtherFees>
<!-- RatePlanID is optional and represents the unique identifier for a
room and package data combination. We strongly recommend using RatePlanID
as a variable to build your dynamic landing page (formerly Point of Sale)
URL and it should be within 50 characters in length for optimal
performance. For details, see Using Variables and Conditions. -->
<RatePlanID>5-ABC</RatePlanID>
<!-- Occupancy is mandatory for RoomBundle elements. -->
<!-- Elements below will get inherited to nested rate elements. -->
<Occupancy>2</Occupancy>
<OccupancyDetails>
<NumAdults>2</NumAdults>
</OccupancyDetails>
<InternetIncluded>1</InternetIncluded>
<!-- Rate rule "mobile" overrides chargeCurrency, "us_or_gb" doesn't. -->
<ChargeCurrency>web</ChargeCurrency>
<Rates>
<Rate rate_rule_id="mobile">
<Baserate currency="USD">258.33</Baserate>
<Tax currency="USD">25.83</Tax>
<OtherFees currency="USD">1.00</OtherFees>
<!-- The value below overrides ChargeCurrency from roombundle. -->
<ChargeCurrency>hotel</ChargeCurrency>
</Rate>
<Rate rate_rule_id="us_or_gb">
<Baserate currency="USD">268.33</Baserate>
<Tax currency="USD">26.83</Tax>
<OtherFees currency="USD">1.00</OtherFees>
</Rate>
</Rates>
</RoomBundle>
</Result>
</Transaction>
不提供公共双人间
以下示例展示了包含无公开双人入住费率的条件式费率的交易消息:
<?xml version="1.0" encoding="UTF-8" ?>
<Transaction timestamp="2023-05-18T16:20:00-04:00" id="42">
<Result>
<Property>1234</Property>
<Checkin>2023-04-10</Checkin>
<Nights>1</Nights>
<!-- <Unavailable/> should not be specified when available nested rates
exist. -->
<Baserate currency="USD">-1</Baserate>
<Tax currency="USD">0</Tax>
<OtherFees currency="USD">0</OtherFees>
<Rates>
<!-- The rate_rule_id is required when using conditional rates. -->
<Rate rate_rule_id="mobile">
<Baserate currency="USD">180.00</Baserate>
<Tax currency="USD">18.00</Tax>
<OtherFees currency="USD">1.00</OtherFees>
<Custom1>ratecode123</Custom1>
</Rate>
</Rates>
</Result>
</Transaction>
更新着陆页文件
为确保符合条件的最终用户可以通过深层链接预订折扣房价,请修改着陆页文件。您可能还需要在预订网站上进行额外的实现,才能正确显示和提供折扣费率。
我们希望合作伙伴遵守在条件式费率深层链接中显示的价格。
在动态深层链接中,您可以通过 RATE-RULE-ID
变量,使用 <RateRule>
元素的 id
属性按名称添加费率规则。
以下示例添加了费率规则 ID:
https://bookingsite.com/landing.do?id=(PARTNER-HOTEL-ID)&arrival=(CHECKINDAY)-(CHECKINMONTH)-(CHECKINYEAR)&departure=(CHECKOUTDAY)-(CHECKOUTMONTH)-(CHECKOUTYEAR)&lang=(USER-LANGUAGE)¤cy=(USER-CURRENCY)&prid=(RATE-RULE-ID)
着陆页文件还支持 IF-RATE-RULE-ID
指令,可让您根据费率规则的存在与否有条件地定义网址的部分:
https://bookingsite.com/(IF-RATE-RULE-ID)privatelanding.do(RATE-RULE-ID)(ELSE)landing.do(ENDIF)?id=(PARTNER-HOTEL-ID)&arrival=(CHECKINDAY)-(CHECKINMONTH)-(CHECKINYEAR)&departure=(CHECKOUTDAY)-(CHECKOUTMONTH)-(CHECKOUTYEAR)&lang=(USER-LANGUAGE)¤cy=(USER-CURRENCY)
此示例会在两个着陆页之间进行选择,具体取决于是否设置了费率规则 ID。
如需了解详情,请参阅使用变量和条件。