ตั้งค่าโหมดความยินยอมสำหรับหน้า AMP
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ตัวเลือกการปรับแต่งพารามิเตอร์โหมดความยินยอมในแท็กข้อมูลวิเคราะห์ AMP มีจํากัด 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 Tag Manager
<!-- 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
โดยค่าเริ่มต้น ระบบจะปฏิเสธความยินยอมad_personalization
สําหรับผู้ใช้ที่อยู่ในเขตเศรษฐกิจยุโรป (EEA) คุณลบล้างการปรับโฆษณาตามโปรไฟล์ของผู้ใช้ได้โดยใช้แท็ก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 Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-11-09 UTC
[null,null,["อัปเดตล่าสุด 2024-11-09 UTC"],[[["\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"]]