Consent-Wall
Integration guide for the contentpass consent-wall in combination with third-party consent management platforms (CMPs).
contentpass Consent-Wall Integration
contentpass is typically integrated with consent management platforms (CMPs) in so called consent-walls. In this scenario, contentpass offers paid subscriptions and the respective CMP takes care of handling user privacy choices. There are two ways to achieve such a set up:
- contentpass is responsible for rendering the first layer (consent-wall) and interacts with the CMP using the CMP's JavaScript API for privacy settings.
- The CMP is responsible for rendering the first layer (consent-wall) and interacts with contentpass using the contentpass' JavaScript API for paid subscriptions.
Integration Option 1: Wall Rendered by contentpass
This integration guide assumes that the consent-wall that asks users to decide between ads/tracking and paid access (contentpass) will be rendered by the contentpass system. It requires integration of contentpass with the CMP that will be used. Currently supported CMPs include: Usercentrics, Consentmanager. Other CMPs can be integrated on demand.
Steps:
- Configure CNAME Record for contentpass Session Management
- Include contentpass JavaScript API
- Render Consent-Wall for Unknown Users
Since 3rd-party cookies don’t work reliably anymore in most browsers, contentpass subscribers must be identified using a 1st-party session.
The following information needs to be provided before the integration process can start:
- A list of domains where the consent-wall is supposed to be installed. For each such domain:
- The CMP vendor that is used.
- A logo image (SVG or PNG).
- The URLs for Imprint, Contact-Page, Terms and Privacy Policy.
1. Configure CNAME Record for contentpass Session Management
To simplify handling of these 1st-party sessions, contentpass provides an endpoint that must be configured behind a CNAME subdomain of the publisher’s first-party domain. In the following example we assume that the publisher’s website is: https://www.publisher.com and the PROPERTY_ID is 12345. You can find your PROPERTY_ID in the settings of your property. Can't find it? Get in touch with us at to obtain your PROPERTY_ID.
A CNAME must be set up as follows:
cp.publisher.com. 300 IN CNAME 12345.with.contentpass.net.
Once the CNAME has been set up, contentpass will automatically provision the required SSL certificates.
2. Include contentpass JavaScript API
On the publisher page the contentpass JavaScript API must be included in order to be able to check the login and subscriptions status of the current user:
<script>
// prettier-ignore
!function(C,o,n,t,P,a,s){C['CPObject']=n;C[n]||(C[n]=function(){
(C[n].q=C[n].q||[]).push(arguments)});C[n].l=+new Date;a=o.createElement(t);
s=o.getElementsByTagName(t)[0];a.src=P;s.parentNode.insertBefore(a,s)}
(window,document,'cp','script','https://cp.publisher.com/now.js');
cp('create', 'PROPERTY_ID', {
baseUrl: 'https://cp.publisher.com',
});
cp('render', {
onFullConsent: function () {
// load advertising
},
});
</script>
The PROPERTY_ID is provided by contentpass and all occurrences of cp.publisher.com must be replaced with the respective subdomain that was configured as a CNAME.
3. Render Consent-Wall for Unknown Users
The cp('render') command checks the authentication status of the current user as well as consent settings from the CMP. If a user is neither a subscriber nor has given all necessary consents, the CMP-wall will be rendered.
If the user has given all necessary consents, the onFullConsent callback is triggered. This can be used to load the advertising stack only for users who have provided all necessary consents.
Integration Option 2: Wall Rendered by CMP
This integration guide assumes that the publisher will be responsible for rendering the consent-wall, usually through the CMP in use, that asks users to decide between ads/tracking and paid access (contentpass).
Steps:
- Configure CNAME Record for contentpass Session Management
- Include contentpass JavaScript API
- Connect contentpass With CMP
- Add contentpass Signup/Login Button
Since 3rd-party cookies don’t work reliably anymore in most browsers, contentpass subscribers must be identified using a 1st-party session.
The following information needs to be provided before the integration process can start:
- A list of domains where the consent-wall is supposed to be installed. For each such domain:
- A logo image (SVG or PNG).
1. Configure CNAME Record for contentpass Session Management
To simplify handling of these 1st-party sessions, contentpass provides an endpoint that must be configured behind a CNAME subdomain of the publisher’s first-party domain. In the following example we assume that the publisher’s website is: https://www.publisher.com and the PROPERTY_ID is 12345. You can find your PROPERTY_ID in the settings of your property. Can't find it? Get in touch with us to obtain your PROPERTY_ID.
A CNAME must be set up as follows:
cp.publisher.com. 300 IN CNAME 12345.with.contentpass.net.
Once the CNAME has been set up, contentpass will automatically provision the required SSL certificates.
2. Include contentpass JavaScript API
On the publisher page the contentpass JavaScript API must be included in order to be able to check the login and subscriptions status of the current user:
<script>
// prettier-ignore
!function(C,o,n,t,P,a,s){C['CPObject']=n;C[n]||(C[n]=function(){
(C[n].q=C[n].q||[]).push(arguments)});C[n].l=+new Date;a=o.createElement(t);
s=o.getElementsByTagName(t)[0];a.src=P;s.parentNode.insertBefore(a,s)}
(window,document,'cp','script','https://cp.publisher.com/now.js');
cp('create', 'PROPERTY_ID', {
baseUrl: 'https://cp.publisher.com',
});
cp('authenticate', function (error, user) {
if (error) {
// -> Error handling depending on use case.
return;
}
if (user.hasValidSubscription()) {
// -> Prevent loading of ads, disable all consents in CMP or prevent loading of CMP here.
} else {
// -> Initialize CMP here.
}
});
</script>
The PROPERTY_ID is provided by contentpass and all occurrences of cp.publisher.com must be replaced with the respective subdomain that was configured as a CNAME.
3. Connect contentpass With CMP
The cp('authenticate') command checks the authentication status of the current user. This is the place where the CMP needs to be hooked in: Users who have a valid subscription must not be shown the consent-wall and the contentpass-mode (i.e. no ads & tracking) must be enforced by the publisher website.
4. Add contentpass Signup/Login Button
The contentpass JavaScript API also provides the necessary functions to send users into the signup or login funnel. In order to redirect the user to signup/login, the CMP must render buttons and which execute the following JavaScript calls.
To redirect to signup:
cp('signup');
To redirect to login:
cp('login');
Notes on Availability & Graceful Degradation
While contentpass offers strong high-availability SLAs, there are several mitigation techniques in place to reduce negative impact on the publisher page in case of an outage on the contentpass side.
To authenticate users after their first visit to the publisher website, a signed token (JWT) is stored in localstorage and optionally in a cookie (_cpuser). This token is refreshed either when users actively log in or log out, or asynchronously in the background if necessary. The token is set for both, contentpass subscribers and non-subscribers.
This means that after the first page impression the authentication logic can run in the client without client-to-server communication.
As a further optimization, when stored as a cookie, this token can also be parsed and verified on the server side allowing the website e.g. to exclude delivery of ad tags for contentpass subscribers.