为 AMP 网页设置意见征求模式
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
AMP Analytics 代码中意见征求模式参数的自定义选项有限。AMP 提供内置的意见征求管理功能,例如延迟分析代码,直到用户同意为止,如在 AMP 网页上显示欧洲法规消息和 amp-consent 中所述。
AMP 网页的意见征求管理设置
默认情况下,系统会拒绝欧洲经济区 (EEA) 境内用户的 ad_personalization 同意情况。您可以使用 amp-analytics 代码覆盖广告个性化设置:
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
<amp-analytics type="gtag" data-credentials="include">
<script type="application/json">
{
"vars" : {
"gtag_id": "<DESTINATION_ID>",
"config" : {
"<DESTINATION_ID>": {
"groups": "default",
"allow_ad_personalization_signals": [true|false]
}
}
}
}
</script>
</amp-analytics>
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-01-13。
[null,null,["最后更新时间 (UTC):2026-01-13。"],[],["AMP provides limited consent mode parameter customization for analytics tags. Consent management settings allow specifying which Google services receive consented data, overriding the default. This is achieved using the `dma_cps` list in the `amp-analytics` tag or via Google Tag Manager. `ad_personalization` consent is denied by default for EEA users, but this can be overridden within the `amp-analytics` tag using the `allow_ad_personalization_signals` parameter. Built in consent management, delays analytics tags until consent is provided.\n"]]