pixelperfectat / magento2-klaviyo-hyva-cookie-consent
Cookie consent bridge for Klaviyo Hyva compatibility. Integrates Klaviyo tracking with Pixelperfect_HyvaCookieConsent category-based consent.
Package info
github.com/pixelperfectat/magento2-klaviyo-hyva-cookie-consent
Language:HTML
Type:magento2-module
pkg:composer/pixelperfectat/magento2-klaviyo-hyva-cookie-consent
Requires
- php: ^8.3
- klaviyo/magento2-extension: ^4.0
- magento/framework: ^103.0
- pixelperfectat/magento2-klaviyo-hyva-compat: ^0.1
- pixelperfectat/module-hyva-cookie-consent: ^0.3
Requires (Dev)
- phpunit/phpunit: ^9.6
- pixelperfectat/coding-standard: ^0.1.0
This package is auto-updated.
Last update: 2026-07-06 14:15:02 UTC
README
Bridges Klaviyo Hyvä compatibility with Pixelperfect Cookie Consent.
Requires two packages: this bridge plus its base module pixelperfectat/module-hyva-cookie-consent.
When installed, Klaviyo tracking is gated behind the marketing consent category. Without marketing consent, the Klaviyo CDN script does not load and no tracking calls are made.
How It Works
- Registers Klaviyo as a marketing service in the cookie consent system
- Overrides
window.klaviyoConsentGranted()to checkcookie_consent_groups.marketing - Removes the base Klaviyo CDN script block and replaces it with a consent-gated version
- When user grants marketing consent, Klaviyo activates automatically
Requirements
- PHP 8.3+
- Magento 2.4.x
- pixelperfectat/module-hyva-cookie-consent ^0.3
- pixelperfectat/magento2-klaviyo-hyva-compat ^0.1
- klaviyo/magento2-extension ^4.0
Installation
composer require pixelperfectat/module-hyva-cookie-consent pixelperfectat/magento2-klaviyo-hyva-cookie-consent bin/magento module:enable PixelPerfect_KlaviyoHyvaCookieConsent bin/magento setup:upgrade
Configuration
No configuration required. Once enabled, Klaviyo tracking is automatically gated behind the marketing consent category.