Custom Consent Manager
Integrate your own consent manager with the Freshpaint Web SDK
Freshpaint supports integrating with a custom consent manager in order to ensure you are respecting your users' data privacy choices while still being able to leverage Freshpaint for sending data to your preferred marketing and advertising platforms.
Prerequisites
This guide assumes you have already set up the Freshpaint Javascript SDK and set up at least one data destination in the Freshpaint app. If not, follow these guides to get set up
Installation
There are 2 steps to integrating the Freshpaint SDK with your consent manager:
Initialize Freshpaint with the default (or most recent) consent choices
Set up an event listener to update the user's consent elections whenever they change
To ensure that the Freshpaint SDK loads with the default consent, we need to pass in that consent object at initialization like so:
The initial_consent
object follows the same pattern as the Integrations Object.
Secondly, to ensure that changes to your user's consent are respected, you must set up an event listener on consent changes to update this consent object.
Using the Consent Object
You can pass a consent object into the freshpaint.init
function call to set a default/initial state for the user's consent.
To limit which destinations a user's data is sent to, set All: false
to ensure user events are not sent to any destinations unless the destination is explicitly set to true.
Example:
Last updated