The customization options for consent mode parameters in AMP analytics tags are limited. AMP offers built-in consent management, like delaying analytics tags until consent is given, as detailed in Displaying European regulations messages on AMP pages and amp-consent.
Consent management settings for AMP pages
You can configure the following consent management settings:
Specify which Google services can receive consented data
By default, consent for sending user data to Google for advertising purposes is considered granted for all Google services. You can override this by specifying which Google services can receive data labeled with consent.
Using the standard
amp-analytics
tag, by providing thedma_cps
list:"vars": { "clientId": "CLIENT_ID(custom_cookie)", "gtag_id": "UA-1234-5", "dma_cps": "ads,maps,playstore,search,shopping,youtube", "config": { "AW-2222": {...}, "G-12345678": {...} } }
Using 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>
Use your amp-analytics
tag
By default, ad_personalization
consent is denied for users based in the
European Economic Area (EEA). You can override ad personalization using your
amp-analytics
tag:
<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>