Consent
Overview
The consent component is a non-visual component for the consent of the use of 3rd party cookies. It triggers the loading of a Sourcepoint CMP (Content Management Platform) dialog to allow the user to decide what 3rd party cookies they wish to allow or disallow on their browser. Unless you are utilising React Helmet, it must be placed inside the body of the document during server-side rendering. NewsKit has both an AMP and non-AMP version of this component. The two are not interchangeable so you must ensure you use the correct one.
At the moment this component is supporting two version of the Sourcepoint config. Versions GDPR TCF V2 and GDPR Non-TCF.
Prerequisites
To utilise this component you will need to have a Sourcepoint account and, if required, a Sourcepoint messaging subdomain set up. For more detailed information please see Sourcepoint documentation TCF V2 or documentation Non-TCF.
Usage
Props GDPR TCF V2
Note:
window._sp_.executeMessaging();
is supposed to be called on each (virtual) pageload.baseEndpoint
parameter for optimization reasons. This change is completely backwards compatible. However, it is recommended that older implementations move to the new parameter to benefit from the optimizations.baseEndpoint
parameter for optimization reasons. This change is completely backwards compatible. However, it is recommended that older implementations move to the new parameter to benefit from the optimizations.Note: Call
window._sp_.loadPrivacyManagerModal()
without passing a parameter and the Privacy Manager that displays will be that property's version of the groupPmId Privacy Manager.consentLanguage: "nl"
Props GDPR Non-TCF
Note:
window._sp_.executeMessaging();
is supposed to be called on each (virtual) pageload.Note: Call
window._sp_.loadPrivacyManagerModal()
without passing a parameter and the Privacy Manager that displays will be that property's version of the groupPmId Privacy Manager.consentLanguage: "nl"
How to run on localhost
The minimum parameters for the Consent component to run locally are a sourcePointConfig object with accountId and siteHref for TCFV1 and with an accountId and propertyHref for TCFV1.
The siteHref
or propertyHref
property should be an url that that exists in your account's property group. Contact your sourcepoint account manager.
In a V2 example it would look like this:
1<Consent
2 sourcePointConfigTCFV2={{
3 accountId: accountId,
4 propertyHref: 'http://newskit.co.uk/'
5 }}
6 />
Consent button
By setting renderConsentButton
to false the default consent button will be hidden. This component can be use intead. It gives the flexibilty to place anywhere on the page.