Privacy Management API for NextGen Experiences
If you are using your own privacy management solution or the Experience is embedded on a website with its own privacy management preference center, then you can use the Grow Privacy Management API to pass on the user's preferences to the Experience.
Embedding an Experience on a website
- Sending the privacy settings to Grow requires a small section of JavaScript to be added to the parent page in an HTML script tag:
<script>
NGX.api('app:ready', function() {
NGX.api('privacy:set:consent', {
functional: true,
analytics: true,
marketing: true
});
});
</script>
- Register an app:ready eventListener callback to know when the Experience is ready to receive privacy settings.
NGX.api('app:ready', function () { })
- Set the privacy settings with the API call NGX.api('privacy:set:consent', { } ). The settings parameter should be in the form of an object with the consent types as property names and a boolean value to indicate if consent is given for that consent type.
- You don't need to send all the consent type properties, as they will be merged with the default settings.
The default settings are as follows:
{
necessary: true,
functional: true,
analytics: true,
marketing: true
}
Note: You may not disable the consent setting for Strictly Necessary cookies, which are always set to true.
Publishing an Experience as a Microsite
- Sending the privacy settings to Grow requires a small section of JavaScript to be added to the custom JavaScript area of the Experience settings. To find this area, open the Experience workspace and click Customize. This opens a page where you can access the Edit screen to add the custom JavaScript for this Experience's webpage:
<script>
NGX.api('app:ready', function () {
NGX.api('privacy:set:consent', {
functional: true,
analytics: true,
marketing: true
});
});
</script>
- Register a page:ready eventListener callback to know when the Experience is ready to receive privacy settings.
NGX.api('page:ready', function () { })
- Set the privacy settings with the API call NGX.api('privacy:set:consent', { }). The settings parameter should be in the form of an object with the consent types as property names and a boolean value to indicate if consent is given for that consent type.
- You don't need to send all the consent type properties, as they will be merged with the default settings.
The default settings are as follows:
{
necessary: true,
functional: true,
analytics: true,
marketing: true
}
Note: You may not disable the consent setting for Strictly Necessary cookies, which are always set to true.