Skip to main content

Install GDPR for Web in the <HEAD>

This guide we will take you through the steps to install the Privacy Manager on your page.

To implement Privacy Manager on your website a single tag needs to be placed in the <HEAD> of your website.

  1. Download the Privacy Manager Wrapper Tag from the Admin tab in Console.

  2. Copy the Wrapper Tag and paste it as close to the opening <head> tag as possible on every page of your website

See a sample of the Privacy Manager Wrapper Tag:

Copy the following script and paste it as close to the opening <head> tag as possible on every page of your website, replacing XXXXXX with your App ID:

<script src="https://gdpr-wrapper.privacymanager.io/gdpr/XXXXXX/gdpr-liveramp.js"></script>

Installing the Privacy Manager using the wrapper tag is recommended as it will ensure that you will always have the most up to date version of the Privacy Manager on your site. Alternatively it is possible to install the Privacy Manager directly on your page. For this you need to download the latest configuration tag from the Admin tab in Console.

Why does the Privacy Manager have to be placed on every single page of my site?

Vendors that are working with the IAB Transparency and Consent Framework (TCF) have committed to the TCF policies. Upon loading the vendors will check whether a CMP has been installed and will wait until a consent string is available before executing. This is why the CMP code needs to be placed on every page.

Now you should be all set.

Next step: Test GDPR for Web

Note

To learn some tips on how to make your CMP load faster, see Tips to Improve Loading Speed.

Enable Privacy Manager Preload

Preload is an aggressive method (when combined with inserting the Privacy Manager tag in <head>) by which you can force a high prioritization for the Privacy Manager script connection. Using preload can significantly improve the loading speed and time to first interaction when using Privacy Manager.

Please be aware that attempts to preload too many connections on your property can nullify this strategy for the Privacy Manager. Click here for more information on preload.

Preload is enabled by default and can be turned off. The setting can be found under advanced in the Install section.

In case you are loading Privacy Manager from a tag manager in combination with preload then you will need to reformat the tag.

Example:

<script>

  (function() {

    var link = document.createElement('link');

    link.setAttribute('rel', 'preload');

    link.setAttribute('href', 'https://gdpr.privacymanager.io/1/gdpr.bundle.js" as="script');

    link.setAttribute('as', 'script');

    document.head.appendChild(link);

  })();

</script>

<script async defer src="https://gdpr-wrapper.privacymanager.io/gdpr/[APPID]/gdpr-liveramp.js"></script>

Exclude CMP on Specific Pages

In case you don't want to display the CMP on pages such as the Imprint and Privacy Policy pages, you can exclude them via the TCF API in combination with the addEventListener method and consentNoticeDisplayed event.

Add the following code snippet:

__tcfapi('addEventListener', 2,(tcData, success) => {
if (user_is_navigated_to_specific_pages) {
__tcfapi('toggleConsentTool', 2, () => {}, false);
}
},"consentNoticeDisplayed");

To learn more about existing events, see Events (GDPR for Web).