使用 AMP 的 Cookie 通知,使用 amp-geo 和 amd-consent

Cookie notification with AMP, using amp-geo and amd-consent

我认为这很简单。在页面底部显示带有关闭按钮的 'we use cookies' 警告。

我们的要求很简单,至少给大家看一遍。直接复制隐私政策 link。没有 cookie 阻塞,简单。

那么有没有人有类似的示例 运行 可以用作基准?我正在查看 BBC 的扩音器页面,但它们只针对欧盟国家/地区展示,我正在考虑向所有人展示。

干杯!

如果您只是想 运行 一个直接的 "we use cookies" 通知,没有花哨的装饰,那么 amp-user-notification 可能是适合您的途径。我们在我们的网站上有 运行ning:https://www.craigattachments.com.

amp-user-notification 确实具备进行地理定位的能力,如果该要求出现的话。

https://amp.dev/documentation/components/amp-user-notification

Header 脚本:

<script async custom-element="amp-user-notification" src="https://cdn.ampproject.org/v0/amp-user-notification-0.1.js"></script>

通知代码:

<amp-user-notification
    layout="nodisplay"
    id="amp-user-notification1"
    data-show-if-href="https://foo.com/api/show-api?timestamp=TIMESTAMP"
    data-dismiss-href="https://foo.com/api/dismissed">
    This site uses cookies to personalize content.
    <a href="">Learn more.</a>
   <button on="tap:amp-user-notification1.dismiss">I accept</button>
</amp-user-notification>