The AMP One Tap component is deprecated. This means that new web apps shouldn't use this component, and developers of the existing apps should follow the
migration guide to make any necessary changes to avoid negative impacts for user sign-in to their websites.
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 (世界標準時間)。"],[[["This reference page describes the API of the `\u003camp-onetap-google\u003e` AMP component, which enables One Tap sign-up/sign-in on AMP pages."],["To use this component, you need to place a specific script tag into your AMP pages and configure the component with `data-src` and `layout` attributes."],["The `data-src` attribute specifies the URI of your One Tap intermediate iframe, while the `layout` attribute must be set to \"nodisplay\"."],["Refer to the \"Integrate One Tap using an Iframe\" guide to learn how to use intermediate iframes for this implementation."]]],[]]