Cookie Consent
On this pageShowHide

Cookie Consent

HTML
<script>
  window.SOCIALPROOF_COOKIE_CONSENT = {
    analytics: false,
    marketing: false,
    functional: false
  };
</script>

If your website asks visitors for cookie consent (GDPR), tell Trustisto about it with the window.SOCIALPROOF_COOKIE_CONSENT object. Set it before the initialization snippet.

  • when window.SOCIALPROOF_COOKIE_CONSENT is not set, Trustisto loads as usual
  • when it is set, Trustisto loads only if analytics, marketing and functional are all true; otherwise SP.init() stops: no visitor ID cookie is set, no event is sent and no campaign is shown

After the visitor accepts

HTML
<script>
  window.SOCIALPROOF_COOKIE_CONSENT = {
    analytics: true,
    marketing: true,
    functional: true
  };
  SP.init("WEBSITE_ID");
</script>

Make sure to replace WEBSITE_ID with your Website ID.

When the visitor accepts cookies, update the object and call SP.init() again. The snippets called earlier on that page (e.g. productPage) were queued and are sent once the library is initialized.