CookieFast

Wix Integration

Complete guide for adding CookieFast to your Wix website and ensuring GDPR/ePrivacy compliance.

Quick Start

Step 1: Access Custom Code

  1. Go to your Wix Editor
  2. Click Settings in the left sidebar (gear icon)
  3. Scroll down and click Custom Code under Advanced
  4. Click + Add Custom Code in the head

Step 2: Add CookieFast Script

  1. In the code box, paste:
<script
async
src="https://cdn.cookiefa.st/cookiefast.js"
data-api-key="your-api-key-here"
></script>
  1. Replace your-api-key-here with your actual API key
  2. Configure settings:
    • Code Type: Select Custom Code
    • Add Code to Pages: Select All Pages
    • Place Code in: Select Head
    • Load code: Select Once (default)
  3. Click Apply

Step 3: Get Your API Key

  1. Sign up at CookieFast Dashboard
  2. Create a new property with your Wix domain
  3. Copy the API key
  4. Return to Step 2 and paste it

Step 4: Publish

  1. Click Publish in the top right of Wix Editor
  2. Visit your published site to verify

Cookie Settings Link

In Footer

  1. In Wix Editor, click Add Elements (+) on the left
  2. Click TextAdd a Text Element
  3. Type Cookie Settings
  4. With text selected, click Link icon in toolbar
  5. Select Web Address
  6. Enter: #cookiefast
  7. Click Done
  8. Drag the text to your footer
  9. Style as needed

Using Button

  1. Click Add Elements (+)
  2. Select Button
  3. Add button to page
  4. Double-click button text, type: Cookie Settings
  5. Click Change LinkWeb Address
  6. Enter: #cookiefast
  7. Style button to match your design

Using Code Element (Advanced)

  1. Add Embed Code element
  2. Paste:
<button
id="cookiefast-banner-trigger"
style="
background: #0073aa;
color: white;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
"
>
Cookie Settings
</button>
  1. Position where needed

Disable Wix Cookie Banner

Wix has its own cookie banner. To avoid conflicts:

  1. Go to SettingsCookies & Privacy Policy
  2. Under Cookie Banner, toggle it Off
  3. 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

  1. Go to SettingsIntegrations & Apps
  2. Find Google Analytics
  3. Click Disconnect or Remove

Add via CookieFast

  1. Go to CookieFast Dashboard → Your Property
  2. 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');
})();
  1. Replace G-XXXXXXXXXX with your GA4 Measurement ID

Facebook Pixel

Remove from Wix

  1. SettingsIntegrations & Apps
  2. Find Facebook Pixel
  3. 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

  1. Add Custom Code in SettingsCustom Code
  2. Paste:
<script>
// Wait for CookieFast consent
window.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>
  1. Set Place Code in: Body - end
  2. 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 consent
if (typeof window !== 'undefined') {
window.addEventListener('cookiefast:consent', (event) => {
const { analytics, marketing } = event.detail;
if (analytics) {
// Initialize analytics
initializeAnalytics();
}
if (marketing) {
// Initialize marketing tools
initializeMarketing();
}
});
}
});
function initializeAnalytics() {
// Your analytics code
console.log('Analytics initialized');
}
function initializeMarketing() {
// Your marketing code
console.log('Marketing initialized');
}

Backend Integration

// backend/http-functions.js
import { 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 service
return ok({
success: true
});
}

E-commerce Tracking

For Wix Stores:

  1. Add to Custom Code (Body - end):
<script>
// Track purchases after consent
window.addEventListener('cookiefast:consent', function(event) {
if (event.detail.analytics) {
// Listen for Wix checkout completion
wixWindow.onCheckoutSuccess((orderId) => {
if (window.gtag) {
// Track conversion
gtag('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:

  1. Works with Wix Multilingual
  2. Banner shows in visitor's language
  3. 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

  1. Click Publish
  2. Visit published URL in incognito mode
  3. Banner should appear (unless US visitor)
  4. Test consent acceptance

3. Check Console

  1. Right-click → InspectConsole
  2. Type: window.CookieFast.getConsent()
  3. 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

  1. Publish site: Custom code only works on published sites
  2. Check location: US visitors auto-accept
  3. Clear cookies: Test in incognito
  4. Check code placement: Should be in <head>
  5. View source: Right-click → View Page Source, search for "cookiefast"

Code Not Running

  1. Verify custom code is set to All Pages
  2. Check Place Code in is set to Head
  3. Ensure site is published (not just preview)
  4. Check browser console for errors

Conflicts with Wix Apps

Some Wix apps add their own tracking:

  1. Review all installed apps
  2. Disable cookie/analytics apps
  3. 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.