Search DG Forum
How do I implement Evidon AMP support without using the AMP-Geo tag?
--
## If I’ve helped, accept this response as a solution so that other’s can find is more quickly in the future.
## Have thoughts on Crownpeak products? We'd love to hear them. Speak with the Crownpeak Product Team..
Great @AriWeissman .
I've pasted in below the details from one of our whitepapers on that topic. It provides an explanation on how the AMP consent tag works and offers an alternative to enabling consent support for all countries without using the <amp-geo> tag.
-------
Overview
The default Evidon AMP tag for the Universal Consent Platform (UCP) uses the <amp-geo> tag to control where consent support is needed. Based on customer feedback that consent support would only be offered in the EU, the tag has been implemented to automatically include all EU countries . If you need to support additional countries, they can be added to the list and they will be automatically supported.
Recently we have received requests to enable the amp-consent support for every country. This can be done in our current tag but adding so many additional countries would be tedious and error-prone. This document describes another mechanism to enable this type of support.
How <amp-consent> Works
To better understand the modifications recommended below, here is a very short explanation of how the <amp-consent> tag decides when to show the consent interface.
Evidon AMP Tag
The Evidon team elected to use the <amp-geo> tag as our mechanism to show the consent interface. We did this for a number of reasons but primarily for ease of deployment and speed. By including the geo in our tag, we can set up consent support without needing to roll out a service to be used by the checkConsentHref option. While we never actually ran timings, it seems likely that using the geo tag is faster and more reliable than calling a 3rd party service hosted on the internet.
Showing Consent For All Countries
There are 2 options for modifications to enable consent support for all countries.
Since altering the <amp-geo> tag is self-explanatory, here we will focus on the second option.
Note: We will summarize the steps here, but for full details please visit the amp-consent reference documents at https://www.ampproject.org/docs/reference/components/amp-consent
The trickiest part of this is setting up the service you will use. The AMP team made this a little more difficult by requiring the communication to be a POST (instead of a GET). A GET would have allowed us to just store a simple object on our CDN and return that from the call. But a POST request requires a server to process the request.
You will need to build a web endpoint that accepts a POST. That endpoint will receive the following object structure:
{
“consentInstanceId”: “my-consent”
}
The instance id sent is the name of the consent set up in the <amp-consent> consents object structure. For the evidon tag it will be “gdpr” instead of “my-consent”.
If you are blindly enabling consent support then what is passed in can really just be ignored unless you want to record the request somewhere for logging.
From the service you will need to return the following structure:
{
“promptIfUnknown”: true/false
}
And that is really it for the service. Not much to it, but it may need to allow CORS support so this request can be made from cross-domain requests. Also, it needs to be available globally, so it can be hit from anywhere the amp page is executing.
Once you have a service up and running you just need to modify the tag to use that option. Here’s how to do that.
Let’s assume you set up your service at the following endpoint: “https://www.customer.com/amp/consent”
With that service URL you will modify the provided tag in the following manner:
“consents”:
{ “gdpr”: {
“promptIfUnknownForGeoGroup”: “consentCountries”,
“promptUI”: “evidonConsent”
}
}
To this:
“consents”: {
“gdpr”: {
“checkConsentHref”: “https://www.customer.com/amp/consent”,
“promptUI”: “evidonConsent”
}
}
That is all there is to it. Do a little testing to make sure it all works, but you should now be requiring consent from all countries for the AMP tag.
--
## If I’ve helped, accept this response as a solution so that other’s can find is more quickly in the future.
## Have thoughts on Crownpeak products? We'd love to hear them. Speak with the Crownpeak Product Team..