Wix cookie banner

Add a GDPR cookie banner to your Wix site

Wix lets you add site-wide code to the <head> from your dashboard. Add PrivacyPill there once and every page gets a fair consent banner with Google Consent Mode v2.

Updated 28 October 2026

Set it up in 5 steps

  1. 1Check the prerequisitesWix runs custom code only on a published site with a connected domain, which requires a paid Wix plan.
  2. 2Open Custom CodeIn your site's dashboard go to Settings → Custom Code (under Development & integrations) and click + Add Custom Code. Paste the snippet and name it 'PrivacyPill'.
  3. 3Place it in the head of all pagesUnder Add Code to Pages choose All pages and Load code once. Under Place Code in, choose Head.
  4. 4Mark it as essentialUnder Code Type, choose Essential so Wix doesn't hold back the consent banner itself until consent. Click Apply.
  5. 5Switch off any other banner and publishIf you installed Usercentrics for Wix, open it and turn Show banner off. Then publish and test on your live domain in a private window.
HTML · Wix custom code
<!-- PrivacyPill: keep this first in <head>, before Google Tag Manager or analytics -->
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag('consent','default',{ad_storage:'denied',ad_user_data:'denied',ad_personalization:'denied',analytics_storage:'denied',functionality_storage:'denied',personalization_storage:'denied',security_storage:'granted',wait_for_update:500});</script>
<script src="https://privacy-pill-consent-studio.lovable.app/api/public/v1/pp.js?site=pp_your_site_key"></script>

Replace pp_your_site_key with your site key — you'll get it when you save your banner.

Wix's own integrations

Analytics and pixels connected through Wix Marketing Integrations (Google Analytics, Meta Pixel and others) or apps from the Wix App Market run through Wix, not through your custom code — a third-party banner can't block them by itself. For full control, connect those tools via custom code instead, categorised as analytics or marketing, and let PrivacyPill's Consent Mode signals govern Google tags.

Don't use an HTML embed element

An Embed HTML element on a page is an iframe in the page body — it can't protect the rest of your site. Always use Settings → Custom Code with Head placement.

Frequently asked questions

Set up PrivacyPill on other platforms

See all

Try it on your own site

Design your banner, preview it live, and paste one line. Free for one domain.