Back to the help center

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.

window.GetCookies.onConsentChange(function (consent) {
  console.log('Consent updated', consent.choices);
  if (consent.choices.analytics) {
    // start analytics
  } else {
    // disable analytics
  }
});
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.GetCookies being 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.