Integrations
KKlaviyo
preset documentationDocumentation

CookiePilot Klaviyo preset: newsletter works, tracking waits for consent

Klaviyo in a store usually combines newsletter forms, user identification and marketing automation. The preset helps separate newsletter opt-in from onsite tracking and starts tracking only after the right consent.

Consent behaviour

Category: marketing, sometimes preferences for forms.

Common global: _learnq.

Requires separating forms from behavioural tracking.

Setup steps

Check that the newsletter form does not set tracking cookies before consent.

Start onsite tracking after marketing granted.

Document newsletter opt-in separately from cookie consent.

Example snippet

Example snippet
<script>
window.addEventListener('cookiepilot:consent', function (event) {
  var consent = event.detail || {};
  if (!consent.marketing || window.__klaviyoLoaded) return;
  window.__klaviyoLoaded = true;

  var script = document.createElement('script');
  script.async = true;
  script.src = 'https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=KLAVIYO_COMPANY_ID';
  document.head.appendChild(script);
});
</script>

Test checklist

The form works without breaking the page.

No behavioural identification before consent.

After Accept, Klaviyo starts only within the selected scope.

Related integrations

See the setups that most often appear together with this integration.

Ready to configure it?

Start CookiePilot, choose the right integration and verify that tags wait for user consent before they run.