條件式費率

條件式費率是一種費率規則,可讓您根據使用者的裝置、國家/地區或使用者是否已登入 Google 等條件,為行程提供不同的費率。

如果行程或房型套裝組合有超過一個公開或條件式費率,使用者會看到最低費率。Google 一律會為使用者挑選符合資格的最低費率。

總覽

條件式費率會顯示在標準價格版位中,且只會向搜尋內容符合相關條件式費率條件的使用者顯示。這些條件可依據下列項目建立:

如要啟用條件式費率,請修改下列項目:

裝置專屬條件式費率

裝置專屬費率是指只有使用特定裝置 (例如行動裝置、平板電腦或電腦) 的使用者才能查看及預訂的飯店房價。費率由 Google 合作夥伴提供,使用者可以在合作夥伴網站上查看及預訂相同的裝置專屬費率。

fenced_rates

國家/地區專屬條件式費率

特定國家/地區費率是指只有搜尋特定國家/地區飯店的使用者才能查看及預訂的飯店費率。Google 會根據使用者的 IP 位址判斷國家/地區。費率由 Google 合作夥伴提供,使用者可以在合作夥伴的國家/地區專屬網站上查看及預訂相同的國家/地區專屬費率。

語言專屬條件式費率

只有在 Google 中使用特定語言設定搜尋飯店的使用者,才會看到特定語言的房價。請使用 <LanguageCode> 元素定義語言特定條件。

With Context 查詢要求訊息中未指定語言。因此,如果您在費率規則中指定 <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 參考資料

更新價格動態饋給

您可以使用交易訊息中的元素設定條件式費率。

<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 multiple

以下範例顯示交易訊息,其中包含 <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)&currency=(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)&currency=(USER-CURRENCY)

這個範例會根據費率規則 ID 是否已設定,選擇兩個到達網頁。

詳情請參閱「使用變數和條件」。