amp-html - AMP 的 Cookie 通知,使用 amp-geo 和 amd-consent
问题描述
我以为这很简单。在页面底部显示“我们使用 cookie”警告并带有关闭按钮。
我们的要求很简单,至少向大家展示一次。带有隐私政策链接的直接副本。没有 cookie 阻塞,简单。
那么有没有人有一个类似于我可以用作基线的示例运行?我正在查看 BBC 的 amp 页面,但它们仅针对欧盟国家/地区显示,我正在为每个人显示此内容。
干杯!
解决方案
如果您只是想直接运行“我们使用 cookie”通知而没有花哨的装饰,那么amp-user-notification
可能是适合您的路线。我们在我们的网站上运行它:https ://www.craigattachments.com 。
amp-user-notification
如果出现该要求,它也确实具有进行地理定位的能力。
https://amp.dev/documentation/components/amp-user-notification
标题脚本:
<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>
推荐阅读
- reactjs - react-boilerplate rootSaga
- javascript - 使用 Javascript 进行验证
- java - log4j 数据库附加程序无法正常工作
- scala - 加入与条件相同的最后一个字母的数据帧
- smartcard - Java Card:发送 T=0 的长响应
- reactjs - antd中选择标签的占位符属性不起作用
- android - 如何使用 ViewTreeObserver.OnGlobalLayoutListener() 从回收器视图项访问图像视图
- sap-ase - 获取 AUTO INCREMENT 的下一个值
- java - 如何将 Python 套接字转换为 Java?Tello DJI 无人机
- variables - 在 go 中声明一个没有值的全局变量