Wix Integration
Complete guide for adding CookieFast to your Wix website and ensuring GDPR/ePrivacy compliance.
Quick Start
Step 1: Access Custom Code
- Go to your Wix Editor
- Click Settings in the left sidebar (gear icon)
- Scroll down and click Custom Code under Advanced
- Click + Add Custom Code in the head
Step 2: Add CookieFast Script
- In the code box, paste:
<scriptasyncsrc="https://cdn.cookiefa.st/cookiefast.js"data-api-key="your-api-key-here"></script>
- Replace
your-api-key-herewith your actual API key - Configure settings:
- Code Type: Select Custom Code
- Add Code to Pages: Select All Pages
- Place Code in: Select Head
- Load code: Select Once (default)
- Click Apply
Step 3: Get Your API Key
- Sign up at CookieFast Dashboard
- Create a new property with your Wix domain
- Copy the API key
- Return to Step 2 and paste it
Step 4: Publish
- Click Publish in the top right of Wix Editor
- Visit your published site to verify
Cookie Settings Link
In Footer
- In Wix Editor, click Add Elements (+) on the left
- Click Text → Add a Text Element
- Type
Cookie Settings - With text selected, click Link icon in toolbar
- Select Web Address
- Enter:
#cookiefast - Click Done
- Drag the text to your footer
- Style as needed
Using Button
- Click Add Elements (+)
- Select Button
- Add button to page
- Double-click button text, type:
Cookie Settings - Click Change Link → Web Address
- Enter:
#cookiefast - Style button to match your design
Using Code Element (Advanced)
- Add Embed Code element
- Paste:
<buttonid="cookiefast-banner-trigger"style="background: #0073aa;color: white;padding: 10px 20px;border: none;border-radius: 4px;cursor: pointer;font-size: 14px;">Cookie Settings</button>
- Position where needed
Disable Wix Cookie Banner
Wix has its own cookie banner. To avoid conflicts:
- Go to Settings → Cookies & Privacy Policy
- Under Cookie Banner, toggle it Off
- Or customize to work alongside CookieFast
Wix's default banner is basic. CookieFast provides more control and better compliance.
Google Analytics Integration
Remove from Wix Settings
- Go to Settings → Integrations & Apps
- Find Google Analytics
- Click Disconnect or Remove
Add via CookieFast
- Go to CookieFast Dashboard → Your Property
- Under Analytics category, add:
// Google Analytics 4(function() {var script = document.createElement('script');script.async = true;script.src = 'https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX';document.head.appendChild(script);window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-XXXXXXXXXX');})();
- Replace
G-XXXXXXXXXXwith your GA4 Measurement ID
Facebook Pixel
Remove from Wix
- Settings → Integrations & Apps
- Find Facebook Pixel
- Click Disconnect
Add via CookieFast
In CookieFast dashboard under Marketing:
// Facebook Pixel!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js');fbq('init', 'YOUR_PIXEL_ID');fbq('track', 'PageView');
Custom Code Execution
If you need to run code only after consent:
In Wix Custom Code
- Add Custom Code in Settings → Custom Code
- Paste:
<script>// Wait for CookieFast consentwindow.addEventListener('cookiefast:consent', function(event) {var consent = event.detail;if (consent.analytics) {console.log('Analytics consent granted');// Initialize analytics here}if (consent.marketing) {console.log('Marketing consent granted');// Initialize marketing pixels here}});</script>
- Set Place Code in: Body - end
- Apply
Wix Velo (Code)
For Wix sites with Velo enabled:
Page Code
// In your page code (e.g., Home.js)$w.onReady(function () {// Listen for consentif (typeof window !== 'undefined') {window.addEventListener('cookiefast:consent', (event) => {const { analytics, marketing } = event.detail;if (analytics) {// Initialize analyticsinitializeAnalytics();}if (marketing) {// Initialize marketing toolsinitializeMarketing();}});}});function initializeAnalytics() {// Your analytics codeconsole.log('Analytics initialized');}function initializeMarketing() {// Your marketing codeconsole.log('Marketing initialized');}
Backend Integration
// backend/http-functions.jsimport { ok, badRequest } from 'wix-http-functions';export function post_logConsent(request) {const consent = request.body;// Store consent in your Wix database// Or send to external servicereturn ok({success: true});}
E-commerce Tracking
For Wix Stores:
- Add to Custom Code (Body - end):
<script>// Track purchases after consentwindow.addEventListener('cookiefast:consent', function(event) {if (event.detail.analytics) {// Listen for Wix checkout completionwixWindow.onCheckoutSuccess((orderId) => {if (window.gtag) {// Track conversiongtag('event', 'purchase', {transaction_id: orderId,currency: 'EUR'});}});}});</script>
Replace with your actual e-commerce tracking implementation based on your analytics platform.
Multilingual Sites
CookieFast automatically detects language:
- Works with Wix Multilingual
- Banner shows in visitor's language
- No additional configuration needed
Testing
1. Preview Mode
Custom code may not work in Wix Preview mode. Always test on published site!
2. Published Site
- Click Publish
- Visit published URL in incognito mode
- Banner should appear (unless US visitor)
- Test consent acceptance
3. Check Console
- Right-click → Inspect → Console
- Type:
window.CookieFast.getConsent() - Verify consent object
Template Compatibility
CookieFast works with all Wix templates:
- ✅ Blank templates
- ✅ Business templates
- ✅ Online Store templates
- ✅ Portfolio templates
- ✅ Blog templates
- ✅ All premium templates
Performance
- No impact on Wix site speed
- Async loading (non-blocking)
- CDN-delivered (~100ms load)
- Minimal JavaScript footprint
Troubleshooting
Banner Not Showing
- Publish site: Custom code only works on published sites
- Check location: US visitors auto-accept
- Clear cookies: Test in incognito
- Check code placement: Should be in
<head> - View source: Right-click → View Page Source, search for "cookiefast"
Code Not Running
- Verify custom code is set to All Pages
- Check Place Code in is set to Head
- Ensure site is published (not just preview)
- Check browser console for errors
Conflicts with Wix Apps
Some Wix apps add their own tracking:
- Review all installed apps
- Disable cookie/analytics apps
- Use CookieFast for all consent management
GDPR Compliance
CookieFast provides:
- ✅ Compliant consent banner
- ✅ Granular consent categories
- ✅ Consent storage (365 days)
- ✅ Consent logs in dashboard
- ✅ Easy preference management
- ✅ Geo-targeting (EU vs US)
Wix Limitations
Wix Editor X and Studio: Same process, but with more flexibility in placing custom code.
Premium Features
Wix Premium required for:
- Custom code injection (included in all premium plans)
- Custom domain (recommended for GDPR)
- Removing Wix ads
Free Wix sites can still use CookieFast if they upgrade to any premium plan.
