Using the JS Privacy API to integrate a CMP

Learn how to set up an Uberflip Hub to work with an external Consent Management Platform.

Introduction

If you use a Consent Management Platform (e.g. OneTrust, TrustArc, etc.) with your other web properties, you can also use it with your Uberflip Hub. Integrating your Consent Management Platform (CMP) with your Hub allows it to manage cookie consent for your Hub alongside your other web properties. In practice, this means that:

  • Visitors will see the same privacy banner/notification and use the same cookie consent controls across all of your web properties, including your Hub
  • Visitors will only need to dismiss the privacy banner/notification once, and will not see it again when visiting your Hub or another web property
  • Privacy preferences a visitor has set on any web property will be applied to your Hub automatically (along with all other web properties managed by the CMP), avoiding the need for visitors to set them again

Overall, this allows for your Hub to be more closely integrated with your other web properties, and offers visitors a more consistent experience with less friction.

Overview

Developing this integration involves two main tasks. You will need to:

Implement the CMP's privacy banner/cookie consent controls on your Hub. This will replace the Hub's built-in equivalents, and allow visitors to store their privacy settings directly in the CMP. Most CMPs provide an embed code that you can use for this purpose.

Develop code that enables the CMP to control and sync the Hub's privacy settings for each visitor. This allows the CMP to act as the source of truth for visitor privacy settings, and the Hub to automatically adopt a visitor's pre-existing settings. The JS Privacy API provides all the necessary methods you need to do this.

Refer to the pages linked below for detailed descriptions and requirements for each task.

Before you begin

Prerequisites

  • You should have experience working with JavaScript. While example code is provided, this is intended as a template only, and you will need to be able to develop your own solution for your specific circumstances. Uberflip is not able to provide development support.
  • You must have a Consent Management Platform (either third-party of self-created) that is capable of setting and storing visitor privacy/cookie settings. It must also be able to provide a specified visitor's settings upon request in some form.
  • You must have a privacy banner/notification that can be injected into the Hub. This should include (or link to) a privacy policy page. Both elements can be part of your CMP, or may be hosted elsewhere (however, one or both must link to or contain your CMP's cookie consent controls).
  • You will need access to the custom code section(s) of the Hub(s) you want to integrate with the CMP. Please speak with your Uberflip administrator to arrange the appropriate access.

Hub backend configuration

  • Before your integration can be deployed on a Hub, various settings in that Hub must first be configured appropriately. In general, this configuration must be performed by an Uberflip administrator. You can find further details in this companion guide.
  • You will need to understand how Uberflip Privacy Groups correspond to the cookie groups that exist in your CMP, in order to map them in your code. Your Uberflip administrator should provide this, as outlined in the guide linked above.

Deploying code on a Hub

You will use Uberflip's custom code functionality to deploy your code on the Hub(s) you are working with. To learn more about this functionality and how to use it, see this guide.

Note that the code in a custom code block takes effect on the target Hub immediately upon being enabled. If possible, we recommend developing and testing in a sandbox Hub before deploying to a production Hub.


What’s Next

Learn more about the tasks you need to complete to develop this integration: