Integrations
Use the JavaScript API (listen for consent changes)
Listen for consent changes and read consent state from your own code
Hook into consent updates to start/stop services dynamically.
Listen for consent changes
window.GetCookies.onConsentChange(function (consent) {
console.log('Consent updated', consent.choices);
if (consent.choices.analytics) {
// start analytics
} else {
// disable analytics
}
});Check consent on load
const consent = window.GetCookies?.getConsent();
if (consent?.choices.marketing) {
// safe to run marketing code
}Common uses
- Initialize analytics/ads only after consent.
- Toggle personalization features.
- Send custom events to your CDP/BI.
Tips
- Guard for
window.GetCookiesbeing undefined briefly on load. - Keep fallbacks for users who never interact (treat as denied).
Still stuck?
Email [email protected] with your domain and what you tried. Signed-in customers can also open a ticket from the dashboard.