條件式費率是一種費率規範,可讓您根據使用者的裝置、國家/地區或使用者是否已登入 Google 等條件,為行程提供不同費率。
如果行程或 Room Bundle 有多個公開或條件式費率,使用者會看到最低費率。Google 一律會為使用者選擇符合資格的最低費率。
總覽
條件式費率會顯示在標準價格版位中,而且只會向搜尋內容符合相關條件式費率條件的使用者顯示。這些條件的判斷依據如下:
如要啟用條件式費率,請修改下列項目:
費率規範 XML 檔案:定義套用條件式費率的條件。
價格動態饋給:使用交易訊息中的
<Rate>
元素設定費率。到達網頁檔案:在深層連結中加入費率規範專屬值。
裝置專屬的條件式費率
裝置專屬費率是指使用者必須在特定裝置 (例如手機、平板電腦或電腦) 上看到及預訂的飯店費率。費率是由 Google 的合作夥伴提供,使用者可在合作夥伴網站上查看並預訂相同的裝置專屬費率。
特定國家/地區的條件式費率
國家/地區專屬房價是指只有搜尋特定國家/地區飯店的使用者,才能看到且開放預訂的飯店房價。Google 會根據使用者的 IP 位址判斷國家/地區。費率是由 Google 的合作夥伴提供,使用者可在其所在國家/地區的專屬網站上查看並預訂相同的國家/地區專屬費率。
各語言的條件式費率
只有在 Google 搜尋特定飯店、同時採用特定語言設定的使用者,才會看到特定語言費率。您可以使用 <LanguageCode>
元素定義特定語言的條件。
降低取樣條件式費率
只有部分符合資格的使用者才會看到隨機取樣條件式費率。取樣率是使用 <MaxUsersPercent>
元素定義,並採用下列方式計算:
MaxUsersPercent = (number of users selected to view rate)/(total eligible users)
登入的條件式費率
只有登入 Google 帳戶的使用者才能查看登入費率。費率是由 Google 的合作夥伴提供,使用者可在合作夥伴自家網站上查看及預訂費率。登入率是使用 <UserSignedIn>
元素定義。
Google 一律會選擇符合資格的最低費率,因此如果條件式費率高於 <Result>
層級設定的價格,則系統「一律不會」選取條件式費率。如要避免這種情況,請在 <Result>
層級移除費率,並為所有費率設定條件。或者,您也可以請客戶技術顧問針對 <Result>
層級設定的價格使用預設費率規範。
建立費率規範 XML 檔案
條件式費率的費率規範是以費率規範 XML 檔案定義。詳情請參閱費率規範 XML 參考資料。
更新價格動態饋給
您可以使用交易訊息中的元素來設定條件式費率。
<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>
<!-- NOTE: OtherFees is inherited from the above setting -->
<Custom1>ratecode123</Custom1>
</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. 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>
<Custom1>ratebasic</Custom1>
<!-- Neither rate overrides Custom2. -->
<Custom2>ratebasic</Custom2>
<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>
<!-- The value below overrides Custom1 from roombundle. -->
<Custom1>ratecode321</Custom1>
<!-- Custom2 is inherited from roombundle. -->
</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>
<!-- The value below overrides Custom1 from roombundle. -->
<Custom1>ratecode432</Custom1>
<!-- Custom2 is inherited from roombundle. -->
</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>
更新到達網頁檔案
為確保符合資格的使用者能透過深層連結預訂折扣費率,請修改到達網頁檔案。您可能也需要在預訂網站上進行額外導入作業,才能正確顯示並履行折扣費率。
我們希望合作夥伴採用條件式費率深層連結中顯示的價格。
在動態深層連結中,您可以透過名稱、<RateRule>
元素的 id
屬性以及 RATE-RULE-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 的設定,選擇兩個到達網頁。
詳情請參閱使用變數和條件一文。