Integrate RudderStack with the Ketch consent management platform.
5 minute read
Ketch provides a robust consent management system with customizable no-code consent policy templates that adhere to all major privacy laws. It also provides comprehensive cookie categorization and identity resolution across devices, channels, and platforms.
How the integration works
RudderStack supports native Ketch integration only with the JavaScript SDK.
For the other SDKs, you can implement Ketch consent-based event filtering cloud mode destinations, by adding the consentManagement object within the context of the event payload. See Add the Consent Object to Event Payloads for more information.
This section describes how the native Ketch consent management integration works with the JavaScript SDK:
Websites with the Ketch Smart Tag present a consent experience for users to decide the consent purposes based on the applicable regulatory framework.
User consent is stored in the Ketch backend and cached in the user’s browser.
The JavaScript SDK fetches the Ketch consent data and the consent settings specified in the RudderStack dashboard.
The user must consent to at least one of the consent purposes corresponding to the category IDs specified in the dashboard settings for sending events to the destination (both in cloud and device mode).
The SDK attaches the consent management data in the event payloads sent to the RudderStack backend (data plane) for performing the same consent-based filtering for cloud mode destinations.
This approach is helpful in cases where you need to track some user activity and control the SDK and cookie behavior before and after the user provides their consent.
Post-consent user tracking
Note that:
In this approach, you must load the JavaScript SDK after the OneTrust script.
If the user updates their consent preferences, you must refresh the web page for the changes to take effect in the SDK (for both cloud and device mode destinations).
Place the scripts in your web page’s <head> section in the following sequence:
Place the Ketch script. You can get the script by going to your Ketch dashboard and navigating to Experience Server > Properties. Select your Ketch Smart Tag and click Export Code to get the script. For more information, see Ketch documentation.
functiongetCookie(key){returnwindow.document.cookie.split('; ').reduce((r,v)=>{constparts=v.split('=')returnparts[0]===key?decodeURIComponent(parts[1]):r},'')}if(getCookie('_ketch_consent_v1_')){rudderanalytics.load(WRITE_KEY,DATA_PLANE_URL,{consentManagement:{enabled:true,provider:"ketch"}});// Other options
}else{// Waiting for consent
ketch('once','hideExperience',()=>{rudderanalytics.load(WRITE_KEY,DATA_PLANE_URL,{consentManagement:{enabled:true,provider:"ketch"},// Other options
});});}
In the above instrumentation, the SDK is notified that consent management should be enabled, and the user has configured the Ketch tag on their site. The SDK then fetches the user consents from Ketch and filters the destinations and events accordingly.
Pre-consent user tracking
Note that:
In this mode, you can choose to track users as fully anonymous, track only their sessions, or track only with anonymousId as the user identifier. This minimizes any data loss related to attribution, acquisition, and the overall user journey.
Unlike post-consent user tracking, there is no restriction on the loading order of the JavaScript and Ketch SDKs for this use case.
If the user updates their consent preferences, you must invoke the consent API again for the changes to take effect for the cloud mode destinations. For the device mode destinations tied to the consent preferences, reload the web page for the changes to take effect.
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.