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

本頁說明如何開始搭配即時出價使用 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 廣告可能會遭到發布商拒絕
500+ = Ad Exchange 專屬值;應先向出價方傳達
回應 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_ad_url 所提供網址的 AMP HTML 廣告素材。廣告素材伺服器必須在 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 廣告必須在 AMP HTML 中加入有效的 Click 巨集。格式如下:

<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 群組提供的即時出價專屬提案