費率規範 XML 檔案會定義提供條件式費率和不公開費率的規則。你可以在 Hotel Center 的「費率規範」頁面,新增或編輯費率規範 XML 檔案。 如要進一步瞭解條件式費率和不公開費率,請參閱條件式費率和不公開費率。
每項費率規則都需要 id,可在交易訊息的 <Rate> 中參照。<Rate> 參照費率規則 ID 的廣告只會向使用者放送,且放送條件必須符合費率規則的定義。您也可以在到達網頁網址中使用變數,參照費率規則 ID。
<RateRuleSettings>
費率規範 XML 檔案的根元素。<RateRuleSettings> (舊稱 <PrivateRates>) 元素包含:
- <UserRateCondition>元素,用於定義條件式費率和不公開費率的相符條件。舉例來說,您可以建立條件式費率,針對特定國家/地區的所有使用者套用條件。
- 每個 - <RateRule>元素都會定義一個費率規則,供交易訊息中的- <Rate>參照。每個- <RateRule>都會指定條件和 UI 處理方式,建構條件式或不公開房價。
<RateRuleSettings> 元素會出現在費率規則 XML 階層的下列位置:
+<RateRuleSettings>+<UserRateCondition>+<RateRule>+<UserRateCondition>+<RateIneligibility>+<RateModification>
語法
<RateRuleSettings> 元素使用下列語法:
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <UserRateCondition id="some_id" op="[all|any|none]">
    ...
  </UserRateCondition>
  <!-- Required -->
  <RateRule id="rate_rule_id">
    <!-- Required -->
    <UserRateCondition op="[all|any|none]">
      ...
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>屬性
<RateRuleSettings> 元素不含任何屬性。
子元素
<RateRuleSettings> 元素包含下列子項元素:
| 子項元素 | 是否必要? | 類型 | 說明 | 
|---|---|---|---|
| <RateRule> | Required | <RateRule> | 定義相符條件、修改內容,以及放送條件式或不公開費率的資格。需要  | 
| <UserRateCondition> | Optional | <UserRateCondition> | 定義一或多個條件,相符時會提供條件或不公開費率。 您可以透過下列方式定義條件:使用  頂層  | 
條件式費率範例
以下範例說明定義條件費率的基本方式。
建議您參照預先定義的條件,如「行動裝置使用者」範例所示。
行動使用者
下列條件費率範例會參考預先定義的 <UserRateCondition>,定義符合所有行動使用者的費率規則:
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <UserRateCondition id="mobile">
    <UserDeviceType>mobile</UserDeviceType>
  </UserRateCondition>
  <RateRule id="mobile">
    <!-- Referencing pre-defined conditions is recommended -->
    <UserRateCondition reference_id="mobile"/>
  </RateRule>
</RateRuleSettings>
美國使用者
下列條件式費率範例會定義費率規則,並參照預先定義的 <UserRateCondition>,比對在美國搜尋的所有使用者:
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <UserRateCondition id="us">
    <UserCountry>US</UserCountry>
  </UserRateCondition>
  <RateRule id="us">
    <UserRateCondition reference_id="us"/>
  </RateRule>
</RateRuleSettings>
<RateRule>
用於指定下列項目的容器:
- 提供費率的條件
- 費率的價格和 UI 處理方式如有異動
- 使用不公開費率的隱藏式 UI 處理方式
<RateRule> 元素會顯示在費率規則 XML 階層的下列位置:
+<RateRuleSettings>+<UserRateCondition>+<RateRule>+<UserRateCondition>+<RateIneligibility>+<RateModification>
語法
<RateRule> 元素使用下列語法:
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings ...>
  <UserRateCondition ...>
  ...
  </UserRateCondition>
  <!-- At least one RateRule is required. The id attribute is required -->
  <RateRule id="rate_rule_id">
    <!-- One or more UserRateCondition elements (inline or referenced) are required. -->
    <UserRateCondition op="[all|any|none]"> // Inline example
      <Description>user_rate_condition_description</Description>
      <!-- Uses the member rate visible UI treatment -->
      <AlwaysEligibleMembershipProgram>program_name</AlwaysEligibleMembershipProgram>
      <LanguageCode>language_code</LanguageCode>
      <MaxUsersPercent>20</MaxUsersPercent> // 20% of users
      <!-- Requires <RateIneligibility> -->
      <MembershipProgram>program_name</MembershipProgram>
      <UserRateCondition reference_id="user_rate_condition_id"/>
      <UserCountry>country_code</UserCountry>
      <UserDeviceType>[mobile|desktop|tablet]</UserDeviceType>
      <UserListId>id</UserListId>
      <UserSignedIn>[true|false]</UserSignedIn>
      <IsDomestic>[true|false]</IsDomestic>
    </UserRateCondition>
    <RateIneligibility>
      <IneligibilityType>[exact|price_band|existence]</IneligibilityType>
      <IneligibilityReason>[program_member]</IneligibilityReason>
    </RateIneligibility>
    <RateModification>
      <HotelAmenity>[free_wifi]</HotelAmenity>
    </RateModification>
  </RateRule>
</RateRuleSettings>
屬性
<RateRule> 元素的屬性如下:
| 屬性 | 是否必要? | 類型 | 說明 | 
|---|---|---|---|
| id | 必要 | 字串 | 
        費率規則的專屬 ID。這個 ID 會在交易訊息中,透過  最多可輸入 40 個半形字元。 | 
子元素
<RateRule> 元素包含下列子項元素:
| 子項元素 | 是否必要? | 類型 | 說明 | 
|---|---|---|---|
| <RateIneligibility> | Optional | <RateIneligibility> | 指定決定特定 UI 處理方式的值,以顯示 <MembershipProgram>費率。只有在  | 
| <UserRateCondition> | Required | <UserRateCondition> | 定義一或多個條件,相符時會提供條件或不公開費率。 您可以透過  但請注意,如果  | 
| <RateModification> | Optional | <RateModification> | 修改不公開費率的使用者介面處理方式。 | 
| <PromoCode> | Optional | string | 如果套用這項費率規則,請指定要與費率建立關聯的代碼。反映在 PROMO-CODE到達網頁變數中。 | 
<UserRateCondition>
定義一或多個條件,如果相符,系統就會提供條件式或私人費率。
<UserRateCondition> 元素會出現在費率規則 XML 階層的下列位置:
+<RateRuleSettings>+<UserRateCondition>+<RateRule>+<UserRateCondition>+<RateIneligibility>+<RateModification>
語法
<UserRateCondition> 元素使用下列語法:
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings ...>
  <!-- "op" is required for more than one child element -->
  <UserRateCondition id="some_id" op="[all|any|none]">
    <UserDeviceType>device_type</UserDeviceType>
  </UserRateCondition>
  <UserRateCondition id="some_other_id" op="[all|any|none]">
    <UserDeviceType>device_type</UserDeviceType>
  </UserRateCondition>
  <!-- At least one RateRule is required -->
  <RateRule id="rate_rule_id">
    <UserRateCondition reference_id="some_id"/>
  </RateRule>
  <RateRule id="rate_rule_id">
    <UserRateCondition reference_id="some_other_id"/>
  </RateRule>
  <RateRule id="rate_rule_id">
    <UserRateCondition>
      <UserDeviceType>device_type</UserDeviceType>
    </UserRateCondition>
  </RateRule>
<span class="nocode"></RateRuleSettings></span>
屬性
<UserRateCondition> 元素的屬性如下:
| 屬性 | 是否必要? | 類型 | 說明 | 
|---|---|---|---|
| id | Required (if top-level under <RateRuleSettings>) | string | 
      這項  | 
| op | Optional | enum | 
        如果  
 | 
| reference_id | Optional | string | 
        將這個元素定義為參照另一個預先定義的  如果  
 | 
子元素
<UserRateCondition> 元素包含下列子項元素:
| 子項元素 | 是否必要? | 類型 | 說明 | 
|---|---|---|---|
| <AlwaysEligibleMembershipProgram> | Optional | string | 指定費率將使用會員費率可見的 UI 處理方式。 這個元素的值可以是任何會員方案名稱。 | 
| <Description> | Optional | string | 說明 <UserRateCondition>。這項資訊僅供記錄,不會影響功能。 | 
| <LanguageCode> | Optional | string | 指定費率適用於語言與這個雙字母
        語言代碼相符的使用者。 注意:建議您盡可能使用  | 
| <MaxUsersPercent> | Optional | float | 指定向這個百分比的終端使用者隨機提供費率。 此值必須是介於 0 至 100 (含) 的整數。舉例來說,如果輸入 20,系統就會將目標設為 20% 的使用者。 | 
| <MembershipProgram> | Optional | string | 指定費率將使用會員方案 UI 處理方式,如  如要讓  
 | 
| <UserRateCondition> | Optional | <UserRateCondition> | 定義一或多個條件,相符時會提供條件或不公開費率。 具有  | 
| <UserCountry> | Optional | string | CLDR 國家/地區代碼,例如  指定使用者必須位於指定國家/地區。 Google 會根據使用者的 IP 位址判斷其所在國家/地區。 | 
| <UserDeviceType> | Optional | enum | 定義裝置類型條件。允許的值包括: 
 | 
| <UserListId> | Optional | string | 目標對象名單的 Google Ads 使用者名單 ID。 這項條件只能與  | 
| <UserSignedIn> | Optional | boolean | 布林值,指定使用者是否必須登入 Google 帳戶。如果值為 true,表示使用者必須登入。如果值為false,表示使用者不得登入。如果您不在意使用者是否登入,請不要加入<UserSignedIn>條件。 | 
| <IsDomestic> | Optional | boolean | 布林值,用於指定使用者是否必須來自飯店所在的國家/地區。 true值表示使用者必須與飯店位於相同國家/地區。如果值為false,表示使用者可能來自飯店所在國家/地區以外的任何國家/地區。如要進行更精細的控制,請使用<UserCountry>條件。 | 
條件式費率範例
使用者百分比
以下條件式費率範例指定費率會隨機提供給 20% 的使用者:
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="20_percent_users">
    <UserRateCondition>
      <MaxUsersPercent>20</MaxUsersPercent>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
英國和行動使用者
以下條件費率範例定義的費率規則,會使用內嵌 <UserRateCondition>,比對所有在英國使用行動裝置搜尋的使用者:
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="gb_mobile">
    <UserRateCondition op="all">
      <UserCountry>GB</UserCountry>
      <UserDeviceType>mobile</UserDeviceType>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
日本和非日本
以下條件費率範例顯示一項費率規則,適用於日本使用者,另一項費率規則則適用於世界其他地區 (RoW) 的使用者:
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="jp">
    <UserRateCondition>
      <UserCountry>jp</UserCountry>
    </UserRateCondition>
  </RateRule>
  <RateRule id="row_not_jp">
    <UserRateCondition op="none">
      <UserCountry>jp</UserCountry>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
任何、所有和無
以下條件式費率範例說明如何使用 op 屬性,以不同方式比對多項條件,並使用 any、all 和 none 值。舉例來說,如「au_nz」條件所示,您可以使用「any」來比對多個國家/地區的使用者。如au_nz_mobile_tablet率規則所示,您可以使用 all 要求使用者符合多項條件。row_mobile_tablet 費率規則會比對出澳洲和紐西蘭以外世界各地的使用者 (資料列),以及符合 mobile_tablet 條件的使用者。
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <UserRateCondition id="au_nz" op="any">
    <UserCountry>AU</UserCountry>
    <UserCountry>NZ</UserCountry>
  </UserRateCondition>
  <UserRateCondition id="mobile_tablet" op="any">
    <UserDeviceType>mobile</UserDeviceType>
    <UserDeviceType>tablet</UserDeviceType>
  </UserRateCondition>
  <RateRule id="au_nz_mobile_tablet">
    <UserRateCondition op="all">
      <UserRateCondition reference_id="au_nz"/>
      <UserRateCondition reference_id="mobile_tablet"/>
    </UserRateCondition>
  </RateRule>
  <RateRule id="row_mobile_tablet">
    <UserRateCondition op="all">
      <UserRateCondition op="none">
        <UserRateCondition reference_id="au_nz"/>
      </UserRateCondition>
      <UserRateCondition reference_id="mobile_tablet"/>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
不公開費率範例
顯示會員費率 1
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="member_visible">
    <UserRateCondition>
      <AlwaysEligibleMembershipProgram>[enter your program here]</AlwaysEligibleMembershipProgram>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
顯示會員費率 2
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="member_visible_es_only">
    <UserRateCondition op="all">
      <AlwaysEligibleMembershipProgram>[enter your program here]</AlwaysEligibleMembershipProgram>
      <UserCountry>es</UserCountry>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
目標對象名單費率 1
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="audience_list">
    <UserRateCondition>
      <UserListId>[enter an audience list id]</UserListId>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
目標對象名單費率 2
這個不公開費率範例說明如何為多份目標對象名單指定會員費率,並在使用者介面中顯示:
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="membership_program">
    <UserRateCondition op="all">
      <AlwaysEligibleMembershipProgram>[enter the program name here]</AlwaysEligibleMembershipProgram>
      <UserRateCondition op="any">
        <UserListId>[enter one audience list id here]</UserListId>
        <UserListId>[enter another audience list id here]</UserListId>
      </UserRateCondition>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
<RateIneligibility>
指出如何顯示隱藏會員費率的 UI 處理方式。如果未包含,系統就不會顯示隱藏會員費率的 UI 樣式。
如要在 <RateRule> 中使用 <RateIneligibility>,也必須在 <RateRule> 的 <UserRateCondition> 元素中指定 <MembershipProgram>。
<RateIneligibility> 元素會顯示在費率規則 XML 階層的下列位置:
+<RateRuleSettings>+<UserRateCondition>+<RateRule>+<UserRateCondition>+<RateIneligibility>+<RateModification>
語法
<RateIneligibility> 元素使用下列語法:
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings ...>
  <UserRateCondition ...>
  ...
  </UserRateCondition>
  <RateRule ...>
    <UserRateCondition ...>
      ...
      <!-- Required when using RateIneligibility -->
      <MembershipProgram>program_name</MembershipProgram>
      ...
    </UserRateCondition>
    <RateIneligibility>
      <IneligibilityType>[exact|price_band|existence]</IneligibilityType>
      <IneligibilityReason>[program_member]</IneligibilityReason>
    </RateIneligibility>
  </RateRule>
</RateRuleSettings>
屬性
<RateIneligibility> 元素不含任何屬性。
子元素
<RateIneligibility> 元素包含下列子項元素:
| 子項元素 | 是否必要? | 類型 | 說明 | 
|---|---|---|---|
| <IneligibilityType> | Required | enum | 定義文字 (顯示在劃掉的費率旁) 如何說明隱藏費率。 有效值如下: 
 如要進一步瞭解 UI 處理方式,請參閱不公開費率的詳細資料和範例。 | 
| <IneligibilityReason> | Required | enum | 有效值如下: 
 | 
不公開費率範例
本節包含隱藏會員費率的範例 (基本) 和隱藏會員費率的範例 (多項條件)。你也可以只向部分使用者顯示會員費率。如要顯示會員價,請先傳送最便宜的房型套裝組合的單一會員價,再傳送其餘房型套裝組合的價格。系統不允許設定多個會員費率價格。
如需範例,請參閱「不公開費率範例」。
隱藏會員費率範例 (基本)
確切折扣
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="membership_program">
    <RateIneligibility>
      <IneligibilityReason>program_member</IneligibilityReason>
      <IneligibilityType>exact</IneligibilityType>
    </RateIneligibility>
    <UserRateCondition>
      <MembershipProgram>[enter program name here]</MembershipProgram>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
錶帶折扣
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="membership_program">
    <RateIneligibility>
      <IneligibilityReason>program_member</IneligibilityReason>
      <IneligibilityType>price_band</IneligibilityType>
    </RateIneligibility>
    <UserRateCondition>
      <MembershipProgram>[enter program name here]</MembershipProgram>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
提示折扣
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="membership_program">
    <RateIneligibility>
      <IneligibilityReason>program_member</IneligibilityReason>
      <IneligibilityType>existence</IneligibilityType>
    </RateIneligibility>
    <UserRateCondition>
      <MembershipProgram>[enter program name here]</MembershipProgram>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
隱藏會員費率範例 (多項條件)
op="any"
會員適用的目標對象名單費率 + 非會員適用的隱藏會員費率 (現有折扣)
這個私人費率範例指定了會員費率的 existence 類型,並隱藏使用者介面處理方式,因此只會向使用者顯示,不會向目標對象名單顯示。目標對象名單中的使用者會看到目標對象比率。
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="membership_program">
    <RateIneligibility>
      <IneligibilityReason>program_member</IneligibilityReason>
      <IneligibilityType>existence</IneligibilityType>
    </RateIneligibility>
    <UserRateCondition op="any">
      <MembershipProgram>[enter program name here]</MembershipProgram>
      <UserListId>[enter you audience list id here]</UserListId>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
op="all"
僅向目標對象名單使用者隱藏會員費率
這個私人費率範例指定了隱藏的 exact 類型會員費率 UI 樣式,並以額外文字「加贈免費 Wi-Fi」修改。符合目標對象名單的使用者會看到這個 UI 處理方式。
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="membership_program_for_audience_list">
    <RateIneligibility>
      <IneligibilityReason>program_member</IneligibilityReason>
      <IneligibilityType>exact</IneligibilityType>
    </RateIneligibility>
    <RateModification>
      <HotelAmenity>free_wifi</HotelAmenity>
    </RateModification>
    <UserRateCondition op="all">
      <MembershipProgram>[enter program name here]</MembershipProgram>
      <UserListId>[enter you audience list id here]</UserListId>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
透明/可見的使用者介面
本例說明如何為目標對象名單中的使用者指定兩種 UI 處理方式 (透明和可見的 UI),並為所有其他使用者隱藏費率。
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="membership_program">
    <RateIneligibility>
      <IneligibilityReason>program_member</IneligibilityReason>
      <IneligibilityType>existence</IneligibilityType>
    </RateIneligibility>
    <UserRateCondition op="any">
      <MembershipProgram>[enter program name here]</MembershipProgram>
      <UserRateCondition op="all">
        <UserListId>[enter you audience list id here]</UserListId>
        <AlwaysEligibleMembershipProgram>program_name</AlwaysEligibleMembershipProgram>
      </UserRateCondition>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
<RateModification>
修改不公開費率的使用者介面處理方式。
<RateModification> 元素會出現在費率規則 XML 階層的下列位置:
+<RateRuleSettings>+<UserRateCondition>+<RateRule>+<UserRateCondition>+<RateIneligibility>+<RateModification>
屬性
<RateModification> 元素不含任何屬性。
子元素
<RateModification> 元素包含下列子項元素:
| 子項元素 | 是否必要? | 類型 | 說明 | 
|---|---|---|---|
| <HotelAmenity> | Optional | enum | 搭配  有效值如下: 
 | 
| <PriceMultiplier> | Optional | float | 將這個值乘以基本費率、稅金和費用,即可修改價格。舉例來說,如果  這樣一來,您就能對符合特定費率規則的所有費率套用折扣。 | 
不公開費率範例
飯店設施
為所有使用者隱藏會員費率 (頻帶折扣) + 免費 Wi-Fi
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="membership_program">
    <RateIneligibility>
      <IneligibilityReason>program_member</IneligibilityReason>
      <IneligibilityType>price_band</IneligibilityType>
    </RateIneligibility>
    <RateModification>
      <HotelAmenity>free_wifi</HotelAmenity>
    </RateModification>
    <UserRateCondition>
      <MembershipProgram>[enter program name here]</MembershipProgram>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>
價格乘數
在價格動態饋給中,對行動裝置費率套用 5% 的折扣
<?xml version="1.0" encoding="UTF-8"?>
<RateRuleSettings>
  <RateRule id="mobile">
    <RateModification>
      <PriceMultiplier>0.95</PriceMultiplier>
    </RateModification>
    <UserRateCondition>
      <UserDeviceType>mobile</UserDeviceType>
    </UserRateCondition>
  </RateRule>
</RateRuleSettings>