默认情况下,当用户同意cookie策略时,状态将保存在本地存储中。是否可以使用诸如document.cookie
之类的特定名称自定义terms-accepted=true
的保存状态?
<amp-geo layout=nodisplay>
<script type="application/json">
{
"ISOCountryGroups": {
"nafta": [ "ca", "mx", "us" ],
"whereIsWaldo": [ "unknown" ],
"anz": [ "au", "nz" ]
}
}
</script>
</amp-geo>
<amp-user-notification
layout=nodisplay
id="amp-user-notification1"
data-show-if-not-geo="anz, nafta"
data-dismiss-href="https://example.com/api/echo/post">
This notice is only shown in Canada, Mexico and USA.
<a class="btn" on="tap:amp-user-notification1.dismiss">I accept</a>
</amp-user-notification>
答案 0 :(得分:0)
如果您使用通过data-dismiss-href
指定的端点来设置cookie服务器端,则可以这样做。