Advanced Tutorials

Consent Sharing: AMP <-> Web Standard

3min

By also displaying your site in the AMP version, the site's display domain may not always be the same. In fact, during an AMP view the domain a user is directed to could be a Google domain or your original domain (with a /amp suffix in the visited URL). In the second case, i.e. when users visit the AMP page but with the original domain, it is possible to take advantage of PubConsent's Consent Sharing functionality. That is, if the user has already given consent on the standard website, the consent already given will be used in the AMP version and vice versa. This however requires two simple changes to the PubConsent integration in the AMP version.

Enabling the ACString as a cookie

In the configurator it is necessary to enable the Use compact ACString as cookie item.

By enabling the following item, the ACString consent will be saved as a cookie, so it is necessary to check the space available in the HTTP header for requests to your server (if necessary, increase the cookie limits on your server configurations).

Self-Hosting Index AMP

For this step it is necessary to create a subdomain where you can then provide an index.html with the following content.

HTML


For example, if your website is under the domain: www.thebestpublisher.com then you will have to create a subdomain for example: cmp.thebestpublisher.com where this url will be https://cmp.thebestpublisher.com/amp/index.html present the index.html file with the content indicated above. Now in the integration code on the AMP website you will need to modify the code, making sure to correctly configure the promptUISrc entry Example code:

HTML