飯店清單是一或多個 XML 檔案,列出所有要提供價格資訊的飯店。飯店清單檔案本身不含價格資訊。
飯店清單的根元素是 <listings> 元素,其中包含描述房源的 <listing> 元素。
您可以在初始導入時建立飯店清單,然後在日常維護時新增或移除飯店。
確認檔案符合語法規範。
舉例來說,請使用 UTF-8 編碼,並在 XML 標記中加入 encoding 屬性,指定這個編碼架構。
建立飯店清單後,你可以使用 https://support.google.com/hotelprices/手動上傳至 Google, 或在伺服器上代管清單。
找出並修正資料問題
如要找出並修正飯店清單中的資料問題,請參閱下列文章:
產品資訊規定
如要放送 Google 飯店廣告,飯店清單中列出的房源必須符合下列條件:
- 提供付費房客可入住的房間
- 具有對外開放的實體據點和固定地點
- 固定牆壁和水管
- 最短入住天數不超過 7 天
不符合資格的房源常見例子包括郵輪和公寓,這些房源通常都不符合Listing requirements條件。
露營小屋和其他設有固定牆壁、水管和氣候控制裝置 (包括燃木爐或丙烷暖爐) 的露營場所均符合資格。不符合資格的戶外住宿包括:
- 露營區 (房客入住帳篷)
- 休旅車露營區 (房客自備休旅車)
<listings>
<listings> 是飯店清單的根元素,包含 <language> 元素和至少一個 <listing>。
<listings> 元素會顯示在飯店清單 XML 階層的下列位置:
+ <listings>
+ <language>
+ <datum>
+ <listing>
語法
<listings> 元素使用下列語法:
<?xml version="1.0" encodin>g<="UTF-8"?
listings xmlns:xsi="xsi"
xsi:noNamesp>ace<SchemaLo>cation="s<chema_xsd>&qu<ot;
> language la<nguage>_co<de/lang>uage
d<atum dat>um_code< /datum
> listing listing/listing
...
/listings
屬性
<listings> 元素的屬性如下:
| 屬性 | 是否必要? | 說明 |
|---|---|---|
xmlns:xsi |
必填 | 請設為 http://www.w3.org/2001/XMLSchema-instance。 |
xsi:noNamespaceSchemaLocation |
必填 | 請設為 http://www.gstatic.com/localfeed/local_feed.xsd。 |
子元素
<listings> 元素包含下列子項元素:
| 子項元素 | 是否必要? | 類型 | 說明 |
|---|---|---|---|
| <language> | Required | string | 動態饋給所用的語言。將這個元素的值設為
雙字母語言代碼。例如,英文的語言代碼為 en。 |
| <datum> | Optional | enum | 這個元素會指定動態饋給中提供的經緯度座標所用的大地測量基準或參考模型。如未提供資料值,這個元素的預設值為 WGS84,大多數新式 GPS 裝置都會使用這個值。東京基準面僅適用於日本境內的地址。這個元素的有效值如下:
WGS84 的預設值,請勿在飯店清單中加入 <datum> 元素。
|
| <listing> | Required | <listing> |
一或多個項目,說明動態饋給中的每間飯店。請注意,清單中的每間飯店都必須有網站專屬的 ID,且這個 ID 絕不能重複使用。 |
範例
結構化地址
以下範例顯示部分飯店清單,其中包含結構化地址:
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
<language>en</language>
<listing>
<!-- The value of <id> must be unique to your site for all time. Do NOT reuse IDs. -->
<id>123abc</id>
<name>Belgrave House</name>
<address format="simple">
<component name="addr1">6 Acacia Ave</component>
<component name="addr2">Floor 5</component>
<component name="city">London</component>
<component name="province">Greater London</component>
<component name="postal_code">SW1W 9TQ</component>
</address>
<country>GB</country>
<latitude>35.070374</latitude>
<longitude>-106.213648</longitude>
<phone type="main">123-456-7890</phone>
<category>hotel</category> <!-- You can use whatever property type categories you wish -->
</listing>
...
</listings>
任意形式的地址
以下範例顯示部分飯店清單,其中包含任意形式的地址:
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
<language>en</language>
<listing>
<!-- The value of <id> must be unique to your site for all time. Do NOT reuse IDs. -->
<id>123abc</id>
<name>Belgrave House</name>
<address>6 Elm Ave Unit 3, Boston, MA, 02472</address>
<country>US</country>
<latitude>35.070374</latitude>
<longitude>-106.213648</longitude>
<phone type="main">123-456-7890</phone>
<category>hotel</category> <!-- You can use whatever property type categories you wish -->
</listing>
...
</listings>
選用內容
以下範例顯示部分飯店清單,其中包含選用的 <content>:
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
<language>en</language>
<listing>
<id>123456</id>
<name>My Apartment</name>
<address format="simple">
<component name="addr1">1 Sandstone Building</component>
<component name="city">Los Angeles</component>
<component name="postal_code">90210</component>
<component name="province">CA</component>
</address>
<country>US</country>
<latitude>40.730610</latitude>
<longitude>-73.935242</longitude>
<phone type="main">12345678</phone>
<category>hotel</category> <!-- You can use whatever property type categories you wish -->
<content>
<text type="description">
<link>https://examplelisting.com/listings/12345</link>
<title>3 bedrooms with ocean views</title>
<body>Stay in this newly renovated 3BR house with ocean views.</body>
<date month="7" day="23" year="2023"/>
</text>
<attributes>
<website>https://hotel.example.com</website>
<client_attr name="rating">8.2</client_attr>
</attributes>
<image type="photo" url="https://image_url">
<link>https://image_url</link>
<title>Main hotel picture</title>
</image>
</content>
</listing>
...
</listings>
<listing>
飯店清單 <listings> 元素中的飯店定義。
<listing> 元素會出現在飯店清單動態饋給 XML 階層的下列位置:
+ <listings>
+ <language>
+ <listing>
語法
<listing> 元素使用下列語法:
<?xml version="1.0" encodin>g<="UTF-8&>quo<t;?
lis>tings< ...
list<ing
> !-- Specify listing's child elements in t>he or<de>r shown <bel>ow. -<-
> idhotel_<ID/id>
<namehot>el_name</name
address
> component name<="add>r1"<;street_address_1/comp>onent
comp<onent name>="<addr2"street_add>ress_2/co<mponent
> com<ponent name="city&qu>ot;city_name/<component
> c<omponent name="province>"provi<nce_name/c>ompon<ent
> com<ponent name="postal_code"postal_code/component
/address
!-- You> can <also< define> an address free<form, al>tho>ugh th<is is n>ot recommend<ed: --
> !-<- addres>sfreeform_addr<ess/addre>ss --<
cou>ntrycountry_cod<e/country
> l<atitudehotel_latitude/latitude
longitud>ehotel_longi<tude/l>ongit<ude
>phone< type=&qu>o<t;[fax|main|mobile|tdd|tollfree]"phone_number/phone
>categ<oryhote>l/categ<ory !-- >You< can use> <whatever >property type categories you wish --
contentcontent/content
/listing
/listings
屬性
<listing> 元素沒有屬性。
子元素
<listing> 元素包含下列子項元素:
| 子項元素 | 是否必要? | 類型 | 說明 |
|---|---|---|---|
| <id> | Required | string | 飯店的專屬 ID。
注意:網站中的這個值不可重複。 請勿重複使用 ID,否則嘗試解決房源比對問題時可能會發生問題。 |
| <name> | Required | string | 飯店的名稱,例如:<name>Belgrave House</name> |
| <address> | Required | Object or string | 飯店的完整實際地點。 這個元素會採用單一屬性 你至少須提供飯店的街道地址、城市、州/省或區域,以及郵遞區號。使用
例如: <address format="si>mpl<e" component na>me="add<r1"6 >Aca<cia Ave/component co>mponent< name=&quo>t;a<ddr2"Floor 5/com>ponent< compone>nt <name="city"Lond>on/component < component> na<me="province"Great>er Londo<n/componen>t< compo>nent name="postal_code"SW1W 9TQ/component /address 或者,您也可以提供「任意格式」的地址,但我們不建議這麼做。例如: <address>6 Elm Ave Unit 3, Boston, MA, 02472</address> 請注意,郵政信箱或其他僅供郵寄的地址都不算是完整的實際地址。 |
| <country> | Required | string | 這項房源所在的國家/地區。值必須是雙字母國家/地區代碼。例如美國是「US」,加拿大是「CA」。例如:<country>US</country> |
| <latitude> | Required* | float | 與商家資訊中列出的所在位置對應的緯度,例如:<latitude>37.423738</latitude> 這個值可使用 Google 地圖 API 等地理編碼工具產生。 |
| <longitude> | Required* | float | 與商家資訊中列出的所在位置對應的經度,例如:<longitude>-122.090101</longitude> 這個值可使用 Google 地圖 API 等地理編碼工具產生。 |
| <location_precision> | Optional | integer | 當屬性緯度和經度遭到混淆時,以公尺為單位傳送的屬性位置精確度。如果值為零 (0),表示沒有模糊處理,且為確切位置。注意: 這項元素僅適用於度假民宿。 |
| <phone> | Required* | string | 飯店的一或多個聯絡電話號碼。如果商家資訊是分店,請提供分店專用的電話號碼 (而非總部的電話號碼)。
例如: <!-- Singapore (country code +65) --&g<t; phone type=&qu>ot;main"<+65 67>2<2-2323/phone !-- U.S. (country <code +1) --> >phone type=&quo<t;fax&>quot;+1 408-555-1111/phone 您至少應提供 |
| <category> | Optional | string | 房源類型,例如飯店。合作夥伴可使用任何內部類別來描述房源,例如「商務飯店」、「度假村」、「汽車旅館」等。 |
<content> |
Optional | <content> |
房源的選用詳細資料,例如說明、評分和特色。 |
* 必須輸入電話號碼「或」緯度/經度,建議您同時定義這兩者。
範例
結構化地址
以下範例顯示部分飯店清單,其中包含結構化地址:
<?xml version="1.0" encodin>g<="UTF-8"?
listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gs>tat<ic.com/l>oc<alfeed/lo>cal<_feed.x>sd&qu<ot;
languageen/<la>nguage
listing
!-- The value of id must be unique to your> site< f>or all< ti>me. D<o NO>T reuse IDs. -<-
> id12<3abc/id
nameBelgrav>e House</name
address form>at="sim<ple"
> c<omponent name="ad>dr1&quo<t;6 Acacia> Ave/co<mponent
compone>nt nam<e="ad>dr2&quo<t;Floor 5/component
> component nam<e="ci>ty"<;London/component
comp>onent na<me="p>rovin<ce">Great<er Lond>on</compone>nt
< component nam<e="p>ostal<_code&quo>t;SW1W 9TQ/<component
> /<address
count>ryGB/country<
l>atitu<de35.070>374/l<atitude
> < longitude-106.213648/longitude
phone type="main&qu>ot;<123-456->7890/ph<one
c>ategoryhotel/category !-- You can use whatever property type categories you wish --
/listing
...
/listings
任意形式的地址
以下範例顯示部分飯店清單,其中包含任意形式的地址:
<?xml version="1.0" encodin>g<="UTF-8"?
listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gs>tat<ic.com/l>oc<alfeed/lo>cal<_feed.x>sd&qu<ot;
languageen/<la>nguage
listing
!-- The value of id must be unique to your> site< f>or all< ti>me. D<o NO>T reuse IDs. -<-
> id12<3abc/id>
nameBelgrave House/name
ad<dress6 E>lm Av<e Unit >3,< Boston,> MA, <02472/ad>dress
< c>ountryUS/cou<ntry
>latitude35.<070374/lat>itude<
longitude-10>6.213648/lon<gitude>
<phone ty>pe=&q<uot;main&>q<uot;123-456-7890/phone
categoryhotel/category !-- You can> us<e whatev>er prop<erty type> categories you wish --
/listing
...
/listings
選用內容
以下範例顯示部分飯店清單,其中包含選用的 <content>:
<?xml version="1.0" encodin>g<="UTF-8"?
listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gs>tat<ic.com/l>oc<alfeed/lo>cal<_feed.x>sd&qu<ot>;
la<ngu>ageen</lan>guage
list<ing
> id<123456/id
nameMy Ap>artment</name
address form>at="simple"<;
co>mponent< name="addr1&quo>t;1 Sandsto<ne Buildin>g/compo<nent
component name=&q>uot;c<ity"L>os Ange<les/component
compo>ne<nt name=&q>uot;p<ostal_co>de&qu<ot;9021>0/<componen>t
< component name<="pr>ovinc<e"CA>/component<
/addr>ess
< country>US/country
<latitu>de40.<730610/l>atitu<de
lo>n<gitude-73.935242/longitude
phone type="main"123>45678</phone
> cat<egoryhotel/category !--> You can <use >whatever property type categories you wis<h --
> conte<nt
> text type="descrip<tion&q>uot;
< >linkhttps://examplelisting.com/listings/12345/link
< >span>title3 bedr<ooms with ocean views/title
>bodySta<y in >this ne<wly renova>ted 3BR h<ouse wi>th ocean views./body
< date month=&q<uot;7" day="23&>quo<t; year=&quo>t;2023&<quot;/
> /text<
attributes
websitehttps://h>otel.exam<ple.>com/website
< >span>client_attr< name>="rating"<;8.2/c>lient_a<ttr
> /<attribut>es
< im>age typ<e="p>hoto" url="https://image_url"
linkhttps://image_url/link
titleMain hotel picture/title
/image
/content
/listing
...
/listings
<content>
加入房源資訊,例如評分、設施和其他詳細資料。<content> 元素為選用項目。在 <content> 中,所有子項元素皆為選填。
<content> 元素會出現在飯店清單動態饋給 XML 階層的下列位置:
+ <listings>
+ <language>
+ <listing>
+ <content>
語法
<content> 元素使用下列語法:
<?xml version="1.0" encodin>g<="UTF-8&>quo<t;?
lis>tings< ...
> listin<g
conten<t
> !-- Specify text's child elements in t>he orde<r shown below. --
> text typ<e=&q>uot;descript<ion&q>uot;
< <>/span>linklisting_li<nk/lin>k
< titlelisting_title/<title
> au<thor>listing_author/auth<or
> bod<ylisting_description/body
dat>e month<=&quo>t;MM&qu<ot; day="DD" year=>"Y<YYY"/>
/t<ext
> !-- 0 or more attribut<es: --
> attr<ibutes
websitehttps://hotel.e>xample.com/website<
cli>ent_attr <name="alternate_hotel_id&>quot;altern<ate_hotel_id>/client_a<ttr
client_attr n>ame="hotel_<brand"h>otel_br<and/client_>attr
< client_attr name="rating">;aggreg<ate_rating/client_attr
/attributes
> !-- <a pi>cture of the hote<l or >property-<-
> image type=&quo<t;phot>o"< url=&>quot;<https://>ima<ge_url&q>uot;
< linkhttps://image_url/link
titleMain Hotel Picture/title
/image
/content
/listing
...
/listings
屬性
<content> 元素沒有屬性。
子元素
<content> 元素包含下列子項元素:
| 子項元素 | 是否必要? | 類型 | 說明 |
|---|---|---|---|
| <text |
Optional | Object | 供應商提供的商家資訊相關網頁。 具有下列子元素:
注意:這些元素必須依上述順序顯示。 |
| <review |
Optional | <review> | 內含商家資訊的使用者評論或編輯評論。您的商家資訊可以包含任意數量的評論,不限類型。 您不必在 重要事項: <review> 僅適用於度假民宿帳戶。如需詳細資訊,請與技術客戶經理 (TAM) 聯絡。 |
| <attributes> | Optional | Object | 包含 0 個以上的 <client_attr name="attribute_>name"attri<bute_valuec>lient_attr 如需子項元素的清單和說明,請參閱 所有 如有 |
| <image> | Optional | Object | 重複的標記,包含詳細的圖片資訊。 |
範例
以下範例顯示部分飯店清單,其中包含 <content> 元素:
<?xml version="1.0" encodin>g<="UTF-8"?
listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gs>tat<ic.com/l>oc<alfeed/lo>cal<_feed.x>sd&qu<ot>;
la<ngu>ageen</lan>guage
list<ing
> id<123456/id
nameMy Ap>artment</name
address form>at="simple"<;
co>mponent< name="addr1&quo>t;1 Sandsto<ne Buildin>g/compo<nent
component name=&q>uot;c<ity"L>os Ange<les/component
compo>ne<nt name=&q>uot;p<ostal_co>de&qu<ot;9021>0/<componen>t
< component name<="pr>ovinc<e"CA>/component<
/addr>ess
< country>US/country
<latitu>de40.<730610/l>atitu<de
lo>n<gitude-73.935242/longitude
phone type="main"123>45678</phone
> cat<egoryhotel/category !--> You can <use >whatever property type categories you wis<h --
> conte<nt
> text type="descrip<tion&q>uot;
< >linkhttps://examplelisting.com/listings/12345/link
< >span>title3 bedr<ooms with ocean views/title
>bodySta<y in >this ne<wly renova>ted 3BR h<ouse wi>th ocean views./body
< date month=&q<uot;7" day="23&>quo<t; year=&quo>t;2023&<quot;/
> /text<
attributes
websitehttps://h>otel.exam<ple.>com/website
< >span>client_attr< name>="rating"<;8.2/c>lient_a<ttr
> /<attribut>es
< im>age typ<e="p>hoto" url="https://image_url"
linkhttps://image_url/link
titleMain hotel picture/title
/image
/content
/listing
...
/listings
<attributes>
<attributes> 標記可用於描述房源設施,以及分類房源的評分。
+ <listings>
+ <language>
+ <listing>
+ <content>
+ <attributes>
子元素
| 子項元素 | 是否必要? | 說明 | |
|---|---|---|---|
| <website> | Optional | 飯店的主要網站,如有,則必須位於第一個 <client_attr> 元素之前。範例:
<website>https://hotel.example.com</website> |
|
| <client_attr name="attribute_name"> | Optional | 房源的其他特徵或「屬性」,可使用支援的
attribute_name或
attribute_name指定度假民宿。 |
|
attribute_name 預留位置的值
下表列出 <client_attr name="attribute_name"> 元素中 attribute_name 的有效值。
attribute_name 的值 |
說明 | 有效內容值 |
|---|---|---|
| alternate_hotel_id | 房源的備用 ID。如果需要為動態饋給資訊和預訂引擎分別設定房源 ID,採用各不相同的專屬 ID 會有所幫助。 | 任何字串值 |
| 已淘汰:任何字串類型的自訂屬性。這些資訊不會向使用者顯示。 重要事項:如要使用 |
任何字串值 | |
| hotel_brand | 這間飯店隸屬的品牌,例如「萬豪國際」或「希爾頓」。這項資訊不會向使用者顯示,但可用於將飯店分組。 | 任何字串值 |
| lodging | Lodging
proto 中所有可用欄位的編碼表示法。 |
Base64 編碼字串的
encoded
Lodging proto |
| num_reviews | 商家資訊的評論數。
重點:「num_reviews」只應傳送至度假民宿動態饋給。 |
任何非負整數。 |
| rating | 代表房源整體評分的浮點數。 | 這個數字通常介於 0 到 5、0 到 10 或 0 到 100 之間,但您可以使用任何代表評分系統的範圍。舉例來說,如果 rating_scale 為 5,房源評等應為 3 或 4。 注意:如未指定,預設的評分範圍為 0 到 10。 |
度假民宿的 attribute_name 預留位置值
請參閱度假民宿專用屬性和 XML 範例。
<image>
+ <listings>
+ <language>
+ <listing>
+ <content>
<!-- <review> is allowed in Vacation Rentals only -->
+ <review>
+ <attributes>
+ <image>
圖片會用於在房源 ID 的房源資訊中顯示房源。使用的所有圖片都必須遵守下列規範:
- 建議的圖片顯示比例為 4:3。
- 圖片網址必須可讓 Googlebot 圖片檢索器存取。
如果網站根層級包含 robots.txt,請確認其中包含下列任一選項:
允許 Googlebot 檢索器檢索網站內容,包括圖片。
- User-agent: Googlebot
- Allow: /
允許 Googlebot 圖片檢索器檢索網站上的圖片。
- User-agent: Googlebot-Image
- Allow: /
請勿提供圖片或網站的螢幕截圖。圖片必須是原創的實際圖片或相片。
屬性
"ad"圖片為廣告"menu"如果圖片是餐廳菜單"photo"如果圖片是商家相片
| 屬性名稱 | 是否必要? | 格式 | 說明 |
|---|---|---|---|
| type | Required | Text | 圖片必須符合下列其中一項條件: |
url |
Required | Text | 完整尺寸圖片的網址。使用 url 屬性指定要在該頁面上使用的圖片。 |
| width | Required | A non-negative integer | 圖片寬度 (以像素為單位,建議大於 720 像素) |
| height | Required | A non-negative integer | 圖片高度 (以像素為單位,建議大於 720 像素) |
子元素
| 子項元素 | 是否必要? | 說明 |
|---|---|---|
| <link> | 建議提供,但店面相片資訊必須提供這項資訊。 | 這個標記包含網站上相關圖片所在網頁的有效最新網址。不含圖片本身的網址。
範例:<link><http://www.example.com/magic_pizza/></link> |
| <title> | 已要求 | 這個標記包含圖片的標題。範例:
<title>"Luxury Apart<ment&q>uot;/title |
| <author> | 非必要 | 內容作者的名稱。值可以是使用者名稱,也可以是「名字 姓氏」格式的全名。 |
| <date> | 必填 | 這個標記會指明內容項目的建立日期。您必須輸入年、月和日,如下例所示: <date month="6" day=">7" year="2023"/ |
範例
以下範例顯示部分飯店清單,其中包含圖片標記:
<?xml version="1.0" encodin>g<="UTF-8"?
listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gs>tat<ic.com/l>oc<alfeed/lo>cal<_feed.x>sd&qu<ot;
l>anguage<en/language
listing
content
image type="photo">; url=&qu<ot;h>ttps://image_url&<quot;> width=&q<uot;4>00" height="<300&qu>ot;
< linkhttps://image_u<rl/link>
<titleApartment at Sandstone/title
> <author>Jessi<ca Landl>ord</author
> < date mon>th="6" day="7" year="2023"/
/image
/content
/listing
...
/listings
語法規範
建立 XML 飯店清單時,請遵守下列規範:
使用 Google 的 XSD 架構驗證飯店清單 XML 檔案。
使用 UTF-8 編碼。如要指定這個編碼架構,請在 XML 標記中加入
encoding屬性,如範例所示。你可以在動態饋給中使用
CDATA區段指定資料值。如果使用CDATA區段,請勿逸出特殊字元。針對不在
CDATA區段中的資料值 (包括網址) 使用逸出碼。您可以使用實體碼或字元碼來表示這些特殊字元。 下表列出可使用的常見實體和字元代碼:字元 實體 字元代碼 連字符號 (&) & & 單引號 (') ' ' 雙引號 (") " " 大於 (>) > > 小於 (<) < < 省略不含資料的 XML 元素。舉例來說,如果沒有飯店的經緯度,就不應加入空白的
<latitude/>和<longitude/>元素。在任何情況下,都請勿在 XML 元素中使用 HTML (即使是逸出也一樣)。
如要在上傳前驗證動態饋給,可以使用本機動態饋給 XSD http://www.gstatic.com/localfeed/local_feed.xsd。
如要在動態消息中使用註解,請將註解納入
<!--和-->標記中,如下列範例所示:<!-- This is a comment -->