Skip to main content

Klaviyo Email & SMS Integration Guide

Automatically synchronize website banner consent choices and statutory Global Privacy Control (GPC) signals into Klaviyo subscriber profile properties.


Add this listener script after your Consent Shield tag to sync consent events directly into the _learnq object:

window.addEventListener('consentshield:consent_changed', function(e) {
var consent = e.detail;
var _learnq = window._learnq || [];

// Update Klaviyo profile custom properties
_learnq.push(['identify', {
'$consent_shield_marketing': consent.advertising ? 'consented' : 'declined',
'$consent_shield_gpc': consent.gpc_active ? 'enforced' : 'none',
'$consent_updated_at': new Date().toISOString()
}]);

console.log('[ConsentShield] Klaviyo profile consent metadata updated');
});

2. Preventing Non-Compliant Email / SMS Dispatchโ€‹

In your Klaviyo dashboard:

  1. Create a dynamic segment called Privacy Compliant Subscribers.
  2. Add Definition: $consent_shield_marketing equals consented AND $consent_shield_gpc does not equal enforced.
  3. Target all marketing flows and campaigns exclusively to this segment to eliminate statutory violation exposure.