Atom 0.3 規格

本文件說明使用 Atom 0.3 格式建立 XML 產品資料來源的相關規定。我們已將各個標準屬性連結至正式版 Atom 0.3 規格的對應章節,可協助你從範例中找到關於這些屬性的額外資訊。我們提供了 Atom 0.3 的範例檔案,但針對 Atom 0.3 本身則僅提供概略資料。

第 1 節:Atom 0.3

依據 Atom 0.3 的規格,項目層級共有四項預先定義的元素:名稱、連結、ID 和修改時間。雖然這些元素在 Atom 0.3 標準中屬於選填選項,但在產品資料來源中為必填屬性。

產品資料來源仍須具備其他元素,例如價格和狀況。為填入這些元素和更多產品詳細資訊,Google 新增了 Google Merchant Center 命名空間來擴充 Atom 0.3。定義 Google Merchant Center 命名空間後,即可使用其他元素 (稱為「屬性」),並為產品資料來源中的各項產品提供更多資訊。

以下是含有單一產品的基本 Atom 0.3 文件範例:

<?xml version="1.0"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#"
xmlns:g="http://base.google.com/ns/1.0">
<title>產品資料來源名稱</title> <link href="http://www.example.com" rel="alternate" type="text/html" /> <modified>2005-10-11T18:30:02Z</modified> <author> <name>Google</name> </author> <id>tag:google.com,2005-10-15:/support/products</id> <entry> <title>紅色羊毛上衣</title> <link href="http://www.example.com/item1-info-page.html" /> <summary>這件舒適柔軟的毛衣能為寒冷的冬夜帶來溫暖。</summary> <id>tag:google.com,2005-10-15:/support/products</id> <issued>2005-10-13T18:30:02Z</issued> <modified>2005-10-13T18:30:02Z</modified>
<g:image_link>http://www.example.com/image1.jpg</g:image_link> <g:price>25</g:price> <g:condition>新品</g:condition>
</entry> </feed>

這個範例中包含兩大新增項目,也就是加入了命名空間宣告 (第三行) 和三項屬性 (圖片連結 [image_link]價格 [price]狀況 [condition])。

Google Merchant Center 命名空間宣告

您必須使用下列命名空間宣告,才能使用 Google Merchant Center 命名空間定義的屬性。

xmlns:g="http://base.google.com/ns/1.0"

除了宣告 Google Merchant Center 命名空間外,您也必須在每個屬性標記前加上前置字元,這種做法有助於辨識在命名空間定義的屬性和在 Atom 0.3 定義的元素。此命名空間宣告使用的前置字元為「g」:

<g:image_link>http://www.example.com/image1.jpg</g:image_link>

Google Merchant Center 命名空間的屬性必須加入這個前置字元,否則系統會忽略屬性和其中包含的任何值。

屬性

您可以使用各種相關屬性來說明自家產品,這能大幅提升產品在搜尋結果中出現的機率。除此之外,Google Merchant Center 命名空間定義的許多屬性可以在同一產品中使用多次,這樣你就能在產品資料來源中為產品新增更多資訊。

第 2 節:重要的檢查清單

在提交產品資料來源前,強烈建議你對照下列清單進行檢查,確認檔案的格式正確:

Step 1 檔案名稱的副檔名必須是 .xml。

Step 2 你在 Google Merchant Center 帳戶中註冊的產品資料來源檔案名稱必須符合你為檔案指定的名稱。

Step 3 記得加入命名空間宣告。這些值應該與下列範例完全一致:

  • Google Merchant Center 命名空間:xmlns:g="http://base.google.com/ns/1.0"
  • 自訂屬性命名空間:xmlns:[prefix]="http://base.google.com/cns/1.0",[prefix] 的部分應該填入你在檔案中使用的前置字元。

Step 4 驗證 Google Merchant Center 和自訂 Google Merchant Center 屬性標記中的前置字元,確定和命名空間宣告中定義的前置字元相符。

Step 5 移除不含任何值的屬性。

第 3 節:總結

為著重說明建立 Google Merchant Center XML 產品資料來源的基本概念,本文使用了經過簡化的項目範例。雖然我們允許產品資料來源含有 Atom 0.3 標準或自有命名空間定義的其他元素,但系統處理資料時會忽略這些元素包含的資訊,不會顯示在產品資訊中。我們目前只會處理 Atom 0.3 預設元素中的資料,以及 Google Merchant Center 和自訂 Google Merchant Center 命名空間中的屬性資料。

這對您有幫助嗎?

我們應如何改進呢?
true
5970656090523785648
true
搜尋說明中心
true
true
true
true
true
71525
搜尋
清除搜尋內容
關閉搜尋
主選單
false
false
false
false