AMP HTML 廣告 (而非即時出價)

本頁將說明如何開始使用 AMP HTML 廣告, 即時出價。詳情請參閱下方的資源

高階方法

即時出價要求

RTB 出價要求會指出要求是否來自 AMP 網頁 以及 AMP HTML 廣告相關規定

OpenRTB

AMP 網頁

message SiteExt {
  enum AmpPage {
    // This is not an AMP page.
    DIALECT_HTML = 0;

    // This is an Amp page.
    DIALECT_HTML_AMP = 1;
  }

  // Whether this is an AMP page or not. Omitted if unknown.
  optional AmpPage amp = 1;
  enum VisibilityState {
    VISIBILITY_STATE_UNKNOWN = 0;

    // The page is at least partially visible. For example, in the foreground
    // tab of a non-minimized window.
    VISIBILITY_STATE_VISIBLE = 1;

    // The page is not visible to users. For example, when the page is in a
    // background browser tab, or in a minimized window.
    VISIBILITY_STATE_HIDDEN = 2;
  }

  // The visibility state of the web page containing the ad slot.
  // See https://www.w3.org/TR/page-visibility/.
  // [AdX: BidRequest.page_visibility]
  optional VisibilityState page_visibility = 2 [default =
    VISIBILITY_STATE_UNKNOWN];

  // Information about a browser window's user activation state. See
  // https://html.spec.whatwg.org/multipage/interaction.html#the-useractivation-interface.
  message UserActivation {
    // Indicates whether a user has completed an interaction since page load.
    optional bool wasact = 1;

    // Indicates whether a user is currently interacting with the page.
    optional bool isact = 2;
  }

  // User activation information from the browser for the current request, if
  // the request is for a web page.
  optional UserActivation uact = 5;

  // The set of possible web navigation types that predicate a page load. Each
  // of these types may have different performance characteristics. For example,
  // users going back and forth might experience a faster site than users
  // performing navigation for the first time or submitting forms. See
  // https://w3c.github.io/navigation-timing/#dom-performancenavigationtiming-type.
  enum NavigationType {
    NAVIGATION_TYPE_UNKNOWN = 0;

    // Navigation started by clicking a link, entering the URL in the browser's
    // address bar, form submission, or initializing through a script operation
    // other than reload and back_forward.
    NAVIGATION_TYPE_NAVIGATE = 1;

    // Navigation is through the browser's reload operation, location.reload(),
    // or a Refresh pragma directive like
    // <meta http-equiv="refresh" content="300">.
    NAVIGATION_TYPE_RELOAD = 2;

    // Navigation is through the browser's history traversal operation.
    NAVIGATION_TYPE_BACK_FORWARD = 3;

    // Navigation is initiated by a prerender hint (deprecated). See
    // https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/prerender.
    NAVIGATION_TYPE_PRERENDER = 4;
  }

  // The type of browser navigation that led to the current page. Unset for
  // non-web ad requests.
  optional NavigationType ntype = 6;

  // Indicates that the request is using semi-transparent branding,
  // which means only a truncated version of the request URL will
  // be provided. This decision is made by the publisher, see
  // https://support.google.com/admanager/answer/4584891#urls for context.
  optional bool is_semi_transparent_request = 3;

  // The domain of the partner (of the site owner) with ownership
  // of some portion of ad inventory on the site. The partner's ads.txt file
  // will be hosted here. More detail at
  // http://iabtechlab.com/wp-content/uploads/2021/03/ctv-app-ads-explainer-guide.pdf
  optional string inventorypartnerdomain = 4;
}

AMP HTML 廣告規定

// Ad Exchange extensions for the Imp object.
message ImpExt {
...
  // Possible requirement types for AMP ads.
  enum AmpAdRequirementType {
    // AMP ad requirements unknown.
    UNKNOWN_AMP_AD_REQUIREMENT_TYPE = 1;
    // AMP ads are not allowed.
    AMP_AD_NOT_ALLOWED = 2;
    // Either AMP ads or non-AMP ads are allowed;
    // AMP ads are not early rendered.
    AMP_AD_ALLOWED_AND_NOT_EARLY_RENDERED = 3;
    // Either AMP ads or non-AMP ads are allowed;
    // AMP ads are early rendered.
    AMP_AD_ALLOWED_AND_EARLY_RENDERED = 4;
    // AMP ads are required.
    // Ads that are non-AMP may be rejected by the publisher.
    AMP_AD_REQUIRED = 5;
    // Exchange-specific values above 500.
  }
  optional AmpAdRequirementType ampad = 8
    [default = UNKNOWN_AMP_AD_REQUIREMENT_TYPE];
}

Authorized Buyers 即時出價

AMP 網頁

// Whether this is an AMP page or not.
enum AmpPage {
  // AMP page status unknown.
  UNKNOWN_AMP_PAGE = 0;

AMP HTML 廣告規定

// Possible requirement types for AMP ads.
enum AmpAdRequirementType {
  // AMP ad requirements unknown.
  UNKNOWN_AMP_AD_REQUIREMENT_TYPE = 0;

即時出價回應

OpenRTB

OpenRTB 3.0 和相關的廣告 為支援 AMP HTML 廣告而新增的常見模型,包含在 最新的 IAB 規格草稿,包括:

出價 欄位 Attr 類型 說明
要求 Site.amp amp 整數 Site.amp 欄位會指出網頁是否已轉譯 在 AMP 中,如果不明,就會略過:
0 = 非 AMP 網頁
1 = 網頁是以 AMP HTML 建立而成
要求 ampformat rend 整數 AMP 格式規格說明相關規定和顯示方式 AMP HTML 廣告的行為:
1 = AMP 廣告規定不明
2 = 不允許使用 AMP 廣告
3 = 允許 AMP 廣告或非 AMP 廣告;AMP 廣告不會提早顯示
4 = 允許 AMP 廣告或非 AMP 廣告,且 AMP 廣告會提早顯示
5 = 必須使用 AMP 廣告。發布商可能會拒絕非 AMP 廣告
500+ = 廣告交易平台專屬值;應與出價方溝通
回應 display curl 字串 出價回應中新增了 display.curl,以便提交 透過網址管理廣告素材,包括支援 AMP HTML 廣告。
這是廣告素材標記的網址。適用於廣告素材類型,例如: AMP 廣告、VAST、DAAST 和原生廣告。通常在指定廣告中只有其中一項 Adm 或 curl 有效。

Authorized Buyers 即時出價

Authorized Buyers 出價中的 BidResponse.Ad.amp_ad_url 欄位 回應會接受指向 AMP HTML 廣告素材的網址。相同的欄位已存在 做為 Google OpenRTB 中 Bid 物件中的擴充功能 。

// The URL to fetch an AMPHTML ad. Only one of the following should be set:
// html_snippet, video_url, amp_ad_url, native_ad.
optional string amp_ad_url = 23;

驗證有效 AMP HTML

如要提早顯示 AMP HTML 廣告,廣告交易平台必須進行驗證並 符號,表示廣告是以 amp4ads <html amp4ads> 廣告素材格式撰寫。

採用有效的 AMP HTML 廣告之後,AMP 網頁會提早顯示。廣告 未經驗證為有效 AMP HTML 的廣告,顯示速度會與 非 AMP HTML 廣告

amp_ad_url 中只能傳回 AMP HTML 廣告,

日後如果發布商只需要 AMP HTML 廣告,則未簽署 系統不會轉譯 AMP HTML。

使用 Authorized Buyers 時,如果出價方傳回 將非 AMP HTML 廣告移至需要 AMP HTML 廣告的廣告版位。

伺服器端擷取

如要提早顯示 AMP HTML 廣告,則必須顯示 AMP HTML 廣告內容 且無須用戶端提供額外的躍點這項設計旨在避免 造成使用者體驗不佳的問題。

出價方贏得競價後,廣告交易平台會 伺服器對伺服器請求,以擷取網址中的 AMP HTML 廣告素材 使用 amp_ad_url 指定語言。廣告素材伺服器必須回應並傳回 時間超過 300 毫秒

廣告素材伺服器傳回的 AMP HTML 廣告將注入 廣告版位和後續顯示的廣告請注意,有效的 AMP HTML 廣告不得含有 iframe 或其他 <amp-ad> 代碼。參閱 AMP HTML 廣告規格

Beta 版專屬功能:如需使用這項功能,請與帳戶團隊聯絡

在伺服器對伺服器擷取 AMP HTML 廣告期間 (由 amp_ad_url),Authorized Buyers 可能會傳遞 HTTP 標頭和 IP 從使用者的瀏覽器連到廣告素材伺服器這樣可確保廣告素材 伺服器會收到類似從標準用戶端傳送的資訊 擷取。在某些情況下,IP 位址可能會縮減為前 3 個位元組 (IPv4) 或前 6 個位元組 (IPv6)。如需這項資訊,請與帳戶團隊聯絡 而不是每個特徵的分數以下是 HTTP 標頭範例:

曝光追蹤網址和 Click 巨集

即時出價買方通常會在 出價回應 (為 Bid.burl,即 OpenRTB 2.5)。

使用 Authorized Buyers 時,這些會在用戶端觸發。amp-pixel 會在廣告素材顯示時觸發追蹤網址。amp-analytics 可以處理轉譯以外的更進階追蹤用途。

AMP HTML 廣告必須包含有效的 Click 巨集, 做為 AMP HTML通常採用以下形式:

<a href="%%CLICK_URL_UNESC%%http%3A%2F%2my.adserver.com%2Fsome%2Fpath%2Fhandleclick%3Fclick%3Dclk"></a>
<a href=”https://my.adserver.com/click?google_click_url=%%CLICK_URL_ESC%%”></a>

廣告素材通常包含 Cookie 廣告素材程式碼中的相符像素。AMP HTML 廣告可以使用 amp-pixelamp-analytics 元件如果您的用途無法使用 amp-analyticsamp-pixel,開啟 討論的 GitHub 問題 替代選項凡是可能廣泛運用的新額外資訊,我們都很開心 是由幾家不同的公司組成詳情請見 詳盡 指南技術 指南,瞭解如何建立新擴充功能。

AMP 測試廣告網址範例

您可以使用下列的 AMP HTML 廣告素材範例進行測試:

資源

AMP 專案和 Google 推出了幾項資源,可協助您踏出第一步:

在 AMP 中建立廣告
向 IAB / OpenRTB 群組提出的即時出價專屬提案