Klaviyo Email & SMS Integration Guide
Automatically synchronize website banner consent choices and statutory Global Privacy Control (GPC) signals into Klaviyo subscriber profile properties.
1. Klaviyo Client-Side Consent Listenerโ
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:
- Create a dynamic segment called Privacy Compliant Subscribers.
- Add Definition:
$consent_shield_marketing equals consentedAND$consent_shield_gpc does not equal enforced. - Target all marketing flows and campaigns exclusively to this segment to eliminate statutory violation exposure.