設定 AMP 網頁的同意聲明模式
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
AMP Analytics 代碼中的同意聲明模式參數自訂選項有限。AMP 提供內建的同意聲明管理功能,例如在取得同意聲明前延遲 Analytics 代碼,詳情請參閱「在 AMP 網頁上顯示歐洲法規訊息」和 amp-consent。
AMP 網頁的同意聲明管理設定
您可以設定下列同意聲明管理設定:
指定哪些 Google 服務可接收使用者同意提供的資料
根據預設,所有 Google 服務都會視為已同意將使用者資料傳送給 Google,用於廣告用途。如要覆寫這項設定,您可以指定哪些 Google 服務能接收標記為已取得同意聲明的資料。
使用標準 amp-analytics
標記,提供 dma_cps
清單:
"vars": {
"clientId": "CLIENT_ID(custom_cookie)",
"gtag_id": "UA-1234-5",
"dma_cps": "ads,maps,playstore,search,shopping,youtube",
"config": {
"AW-2222": {...},
"G-12345678": {...}
}
}
使用 Google 代碼管理工具:
<!-- Google Tag Manager -->
<amp-analytics
config="https://www.googletagmanager.com/amp.json?id=GTM-WC8J58F>m.url=SOURCE_URL&dma_cps=ads%2Cmaps%2Cplaystore%2Csearch%2Cshopping%2Cyoutube"
data-credentials="include"></amp-analytics>
使用 amp-analytics
標記
根據預設,系統會拒絕歐洲經濟區 (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>
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-09 (世界標準時間)。
[null,null,["上次更新時間:2024-11-09 (世界標準時間)。"],[[["\u003cp\u003eAMP analytics tags have limited customization for consent mode parameters, relying on built-in AMP consent management.\u003c/p\u003e\n"],["\u003cp\u003eYou can specify which Google services (like ads, maps, or youtube) receive consented user data using the \u003ccode\u003edma_cps\u003c/code\u003e list within your \u003ccode\u003eamp-analytics\u003c/code\u003e tag or Google Tag Manager configuration.\u003c/p\u003e\n"],["\u003cp\u003eBy default, ad personalization is denied for EEA users, but you can override this within your \u003ccode\u003eamp-analytics\u003c/code\u003e tag using \u003ccode\u003eallow_ad_personalization_signals\u003c/code\u003e.\u003c/p\u003e\n"]]],["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"],null,["# Set up consent mode for AMP pages\n\nThe customization options for consent mode parameters in AMP analytics tags are\nlimited. AMP offers built-in consent management, like delaying analytics tags\nuntil consent is given, as detailed in\n[Displaying European regulations messages on AMP pages](https://support.google.com/admanager/answer/11136005) and [amp-consent](https://amp.dev/documentation/components/amp-consent).\n\nConsent management settings for AMP pages\n-----------------------------------------\n\nYou can configure the following consent management settings:\n\n### Specify which Google services can receive consented data\n\nBy default, consent for sending user data to Google for advertising purposes\nis considered granted for all Google services. You can override this by\nspecifying which Google services can receive data labeled with consent.\n\n- Using the standard `amp-analytics` tag, by providing the `dma_cps` list:\n\n \"vars\": {\n \"clientId\": \"CLIENT_ID(custom_cookie)\",\n \"gtag_id\": \"UA-1234-5\",\n \"dma_cps\": \"ads,maps,playstore,search,shopping,youtube\",\n \"config\": {\n \"AW-2222\": {...},\n \"G-12345678\": {...}\n }\n }\n\n- Using Google Tag Manager:\n\n \u003c!-- Google Tag Manager --\u003e\n \u003camp-analytics\n config=\"https://www.googletagmanager.com/amp.json?id=GTM-WC8J58F>m.url=SOURCE_URL&dma_cps=ads%2Cmaps%2Cplaystore%2Csearch%2Cshopping%2Cyoutube\"\n data-credentials=\"include\"\u003e\u003c/amp-analytics\u003e\n\n### Use your `amp-analytics` tag\n\nBy default, `ad_personalization` consent is denied for users based in the\nEuropean Economic Area (EEA). You can override ad personalization using your\n`amp-analytics` tag: \n\n \u003cscript async custom-element=\"amp-analytics\" src=\"https://cdn.ampproject.org/v0/amp-analytics-0.1.js\"\u003e\u003c/script\u003e\n \u003camp-analytics type=\"gtag\" data-credentials=\"include\"\u003e\n \u003cscript type=\"application/json\"\u003e\n {\n \"vars\" : {\n \"gtag_id\": \"\u003cDESTINATION_ID\u003e\",\n \"config\" : {\n \"\u003cDESTINATION_ID\u003e\": {\n \"groups\": \"default\",\n \"allow_ad_personalization_signals\": [true|false]\n }\n }\n }\n }\n \u003c/script\u003e\n \u003c/amp-analytics\u003e"]]