Your site

Consent

By default Usercase starts as soon as the script loads. Turn on requireConsent if your visitors must agree first, for example visitors from the EU, UK or Switzerland.

Until Usercase.consent(true) is called, Usercase does not load, set cookies, write to browser storage or collect anything.

With the script tag, add these two lines to the install code, after w.Usercase.project.

w.Usercase.requireConsent = true;
w.Usercase.consent = w.Usercase.consent || function (g) { w.Usercase.consented = g !== false; };

Call it from your consent banner on every page load. It is safe to call before the Usercase script has finished loading.

  • Usercase.consent(true) starts Usercase if it is waiting for consent.
  • Usercase.consent(false) stops Usercase on this page and removes its cookies (eb_sid_*, eb_mic_label) and browser storage (Usercase* keys). Your site’s own cookies and storage are not touched.
// in your consent banner callback
Usercase.consent(true);   // or Usercase.consent(false)

Usercase does not remember consent. Your consent banner remembers it and calls consent() again on each page.