Powrót do bloga
Platform Guide

Wix Cookie Banner: Custom Implementation Guide

Zespół GetCookiesMarch 25, 20268 min czytania
WixPlatformIntegrationTutorial
Wix Cookie Banner: Custom Implementation Guide

Wix Cookie Banner: Custom Implementation Guide

Date: March 25, 2026 Author: GetCookies Team Category: Platform Guide Reading Time: 8 min


Wix is a fantastic website builder, but its built-in cookie banner can be limiting for advanced compliance needs (like multi-region support or detailed analytics).

Fortunately, Wix's "Custom Code" feature allows you to bypass the native banner and install a robust CMP like GetCookies. This guide shows you how to do it correctly without breaking Wix's native analytics.

The Challenge: Wix's "Marketing Integrations"

Wix tries to be helpful by managing pixels (FB, Google) via its "Marketing Integrations" dashboard.

  • The Problem: These integrations often fire independently of third-party custom code.
  • The Fix: You need to use Wix's Consent Policy API to tell Wix when to fire its own integrations.

Step 1: Disable the Wix Banner

  1. Go to Settings > Privacy & Cookies.
  2. Disable "Display Cookie Banner". (You don't want two banners overlapping).

Step 2: Add GetCookies to Head

  1. Go to Settings > Custom Code.
  2. Click + Add Custom Code.
  3. Paste your GetCookies snippet.
  4. Important: Select "Load code once" and place in "Head".
  5. Essential: Set "Code Type" to "Essential". This ensures the banner loads immediately.

Step 3: Connect GetCookies to Wix API

This is the "Secret Sauce." GetCookies needs to talk to Wix's internal consent system so Wix knows when to fire its integrations.

Add this second snippet to Custom Code > Body - End:

<script>
window.addEventListener('getcookies:consent_updated', function(e) {
  const consent = e.detail;
  
  // Map GetCookies categories to Wix categories
  const policy = {
    essential: true,
    functional: consent.functional,
    analytics: consent.analytics,
    advertising: consent.marketing,
    dataToThirdParty: consent.marketing
  };

  // Push to Wix
  if (window.wixConsentPolicy) {
    window.wixConsentPolicy.setConsentPolicy(policy);
  } else {
    // Wait for Wix API to load
    window.addEventListener('wixConsentPolicyChanged', () => {
       window.wixConsentPolicy.setConsentPolicy(policy);
    });
  }
});
</script>

Why This Works

When a user accepts "Marketing" on the GetCookies banner:

  1. GetCookies fires its own pixels (if you set them up).
  2. The script above runs and tells Wix "Marketing is Allowed."
  3. Wix then fires any pixels you configured in the Wix Dashboard.

This gives you the best of both worlds: GetCookies' superior UI and logs, and Wix's easy integration management.

G

Zespół GetCookies

Napisane i aktualizowane przez zespół GetCookies w Getia AS w Oslo w Norwegii. Ten artykuł zawiera ogólne informacje o zgodzie na pliki cookie i nie stanowi porady prawnej.

Przeskanuj własną stronę za darmo

Darmowy plan wyświetla baner na jednej stronie i daje trzy skany cookies miesięcznie. Bez karty, bez rozmów handlowych.