AMP One Tap 元件已淘汰。也就是說,新的網頁應用程式不應使用這個元件,而現有應用程式的開發人員應遵循
遷移指南做出必要變更,以免使用者登入網站受到負面影響。
AMP 元件 API 參考資料
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本參考頁面說明 <amp-onetap-google>
AMP 元件的 API。
如要瞭解如何使用中繼 iframe,請參閱「使用 iframe 整合 One Tap」指南。
載入 <amp-onetap-google>
AMP 元件
將下列程式碼片段放入要使用 <amp-onetap-google>
AMP 元件的任何 AMP 網頁:
<script custom-element="amp-onetap-google" src="https://cdn.ampproject.org/v0/amp-onetap-google-0.1.js" async></script>
<amp-onetap-google>
AMP 元件
下表列出資料屬性及其相關說明:
屬性 |
data-src |
One Tap 中繼 iframe 的 URI |
layout |
AMP 元件的版面配置。僅允許使用「nodisplay」。 |
data-src
這個屬性是 One Tap 中介 iframe 的 URI。詳情請參閱下表:
類型 |
必填 |
範例 |
字串 |
是 |
data-src="https://example.com/onetap_iframe.html" |
版面配置
這個屬性是 AMP 元件的版面配置,也是 AMP 元件的必要屬性。對於 <amp-onetap-google>
元件,只允許使用「nodisplay」。詳情請參閱下表:
類型 |
必填 |
範例 |
字串 |
是 |
layout="nondisplay" |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-08 (世界標準時間)。
[null,null,["上次更新時間:2024-11-08 (世界標準時間)。"],[[["\u003cp\u003eThis reference page describes the API of the \u003ccode\u003e<amp-onetap-google>\u003c/code\u003e AMP component, which enables One Tap sign-up/sign-in on AMP pages.\u003c/p\u003e\n"],["\u003cp\u003eTo use this component, you need to place a specific script tag into your AMP pages and configure the component with \u003ccode\u003edata-src\u003c/code\u003e and \u003ccode\u003elayout\u003c/code\u003e attributes.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edata-src\u003c/code\u003e attribute specifies the URI of your One Tap intermediate iframe, while the \u003ccode\u003elayout\u003c/code\u003e attribute must be set to "nodisplay".\u003c/p\u003e\n"],["\u003cp\u003eRefer to the "Integrate One Tap using an Iframe" guide to learn how to use intermediate iframes for this implementation.\u003c/p\u003e\n"]]],[],null,["# AMP Component API reference\n\nThis reference page describes the API of the `\u003camp-onetap-google\u003e` AMP\ncomponent.\n\nSee the [Integrate One Tap using an Iframe](/identity/gsi/web/amp/intermediate-iframe) guide to learn how to use\nintermediate iframes.\n\nLoad the `\u003camp-onetap-google\u003e` AMP Component\n--------------------------------------------\n\nPlace the following code snippet into any AMP pages where you want to use the\n`\u003camp-onetap-google\u003e` AMP Component: \n\n \u003cscript custom-element=\"amp-onetap-google\" src=\"https://cdn.ampproject.org/v0/amp-onetap-google-0.1.js\" async\u003e\u003c/script\u003e\n\nThe `\u003camp-onetap-google\u003e` AMP Component\n---------------------------------------\n\nThe following table lists the data attributes with their descriptions:\n\n| Attribute ||\n|----------------------------------------------------------|---------------------------------------------------------------|\n| [data-src](/identity/gsi/web/amp/amp-reference#data-src) | The URI of your One Tap intermediate iframe |\n| [layout](/identity/gsi/web/amp/amp-reference#layout) | The layout of the AMP component. Only \"nodisplay\" is allowed. |\n\n### data-src\n\nThis attribute is the URI of your One Tap intermediate iframe. See the following\ntable for further information:\n\n| Type | Required | Example |\n|--------|----------|-----------------------------------------------------|\n| string | Yes | `data-src=\"https://example.com/onetap_iframe.html\"` |\n\n### layout\n\nThis attribute is the layout of the AMP component, which is a required attribute\nof AMP components. For the `\u003camp-onetap-google\u003e` component, only\n\"nodisplay\" is allowed. See the following table for further information:\n\n| Type | Required | Example |\n|--------|----------|-----------------------|\n| string | Yes | `layout=\"nondisplay\"` |"]]