條件式費率是一種費率規範,可讓您根據使用者的裝置、國家/地區,或使用者是否登入 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>
更新到達網頁檔案
為確保符合資格的使用者能夠透過深層連結預訂折扣費率,請修改您的到達網頁檔案。預訂網站可能需要進行額外的導入作業,才能正確顯示及履行折扣費率。
我們希望合作夥伴能接受條件式費率深層連結中顯示的價格。
在動態深層連結中,您可以透過 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,選擇兩個到達網頁。
詳情請參閱「使用變數和條件」一文。