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.
At the moment this component is supporting three versions of the Sourcepoint config. Versions GDPR TCF V2 and GDPR Non-TCF, these are both legacy implementations (SourcePoint clients implemented before May 5th, 2021 will used these and should be migrated to the Unified Script). The most upto date version is the Unified Script. In addition to GDPR and CCPP the Unified Script has been updated to support MSPA as well.
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 Unified Script or Web Implementation. For legacy implementations documentation TCF V2 or documentation Non-TCF.
Usage
Props Unified Script GDPR TCF
In order to add Sourcepoint script for GDPR, CCPA or USNAT you must add at least an empty gdpr, ccpa or usnat object (see below). The 'usnat' object should contain 'includeUspApi' parameter set to 'true'. This enables both the older ccpa type string as well as the gpp string (part of the MSPS signal). Instructions and additional MSPS settings can be found in this Sourcepoint guide.
Note:
window._sp_.executeMessaging();
is supposed to be called on each (virtual) pageload.The joinHref parameter is solely used to test your implementation across different servers while still allowing for URL RegEx matching.
For these reasons, Sourcepoint strongly recommends that joinHref is set to true to ensure full CMP functionality.
Uses ISO 639-1 language codes.
targetingParams set within the gdpr object will override overall targetingParams
targetingParams set within the gdpr object will override overall targetingParams
targetingParams set within the gdpr object will override overall targetingParams
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.