Set up consent mode for AMP pages

  • AMP analytics tags have limited customization for consent mode parameters, relying on built-in AMP consent management.

  • You can specify which Google services (like ads, maps, or youtube) receive consented user data using the dma_cps list within your amp-analytics tag or Google Tag Manager configuration.

  • By default, ad personalization is denied for EEA users, but you can override this within your amp-analytics tag using allow_ad_personalization_signals.

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.

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 the dma_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&gtm.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>