在AMP中是否可以在cookie中存储amp-user-notification?

时间:2018-10-19 10:35:09

标签: javascript html cookies amp-html

默认情况下,当用户同意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>

1 个答案:

答案 0 :(得分:0)

如果您使用通过data-dismiss-href指定的端点来设置cookie服务器端,则可以这样做。