Hiển thị tính năng Một lần chạm trong trang AMP

Để thêm tính năng Một lần chạm vào Accelerated Mobile Pages của bạn,

  1. Thêm Một lần chạm vào Iframe trung gian được lưu trữ bởi trang web của riêng bạn.

  2. Nhúng iframe trung gian thay vì tính năng Một lần chạm, vào trang AMP bằng thành phần <amp-onetap-google>.

Đặt đoạn mã sau vào bất kỳ trang AMP nào mà bạn muốn Google One nhấn để hiển thị:

<script custom-element="amp-onetap-google" src="https://cdn.ampproject.org/v0/amp-onetap-google-0.1.js" async></script>
<amp-onetap-google
  layout="nodisplay"
  data-src="https://example.com/onetap_iframe.html">
</amp-onetap-google>

Đặt thuộc tính data-src thành URI của iframe trung gian.