Watch how easy it is to add cookie consent to your Squarespace site
Choose your platform and copy the code. It's that simple.
Add this code to your website's <head> section
<!-- Cookie Consent Banner -->
<script>
(function() {
// Cookie consent configuration
const config = {
position: 'bottom',
theme: 'light',
primaryColor: '#3B82F6',
title: 'We use cookies',
message: 'This website uses cookies to improve your experience.',
acceptText: 'Accept All',
rejectText: 'Reject',
preferencesText: 'Preferences'
};
// Initialize banner
window.cookieConsent = config;
})();
</script>
<script src="https://cdn.cookiebanner.com/banner.js"></script>Add to your theme's functions.php or use a plugin
// Add to functions.php
function add_cookie_consent_banner() {
?>
<script>
(function() {
const config = {
position: 'bottom',
theme: 'light',
primaryColor: '<?php echo get_theme_mod("primary_color", "#3B82F6"); ?>',
title: 'We use cookies',
message: 'This website uses cookies to improve your experience.',
acceptText: 'Accept All',
rejectText: 'Reject',
preferencesText: 'Preferences'
};
window.cookieConsent = config;
})();
</script>
<script src="https://cdn.cookiebanner.com/banner.js"></script>
<?php
}
add_action('wp_head', 'add_cookie_consent_banner');Add to your React app's main component
import { useEffect } from 'react';
function CookieConsent() {
useEffect(() => {
const config = {
position: 'bottom',
theme: 'light',
primaryColor: '#3B82F6',
title: 'We use cookies',
message: 'This website uses cookies to improve your experience.',
acceptText: 'Accept All',
rejectText: 'Reject',
preferencesText: 'Preferences'
};
window.cookieConsent = config;
// Load the script
const script = document.createElement('script');
script.src = 'https://cdn.cookiebanner.com/banner.js';
script.async = true;
document.head.appendChild(script);
return () => {
document.head.removeChild(script);
};
}, []);
return null;
}
export default CookieConsent;Click the copy button for your platform
Add to your website's head section
Your banner is live and GDPR compliant
From code to live banner in under 5 minutes
Copy the integration code from your dashboard
<script>
window.cookieConsent = {
position: 'bottom',
theme: 'light',
primaryColor: '#3B82F6'
};
</script>
<script src="https://cdn.cookiebanner.com/banner.js"></script>Add to your theme's functions.php or use a plugin
Paste directly into your website's head section
Add to your main component or _app.js file
Drag the slider to see how your website looks with and without our cookie banner
No cookie banner
❌ Not GDPR Compliant
Risk of €20M+ fines
GDPR compliant
✅ GDPR Compliant
Protected from fines
👆 Drag the slider to see the difference
Setup takes less than 5 minutes
Multiple ways to integrate cookie consent with your Squarespace site
Easiest method for most Squarespace users
<!-- Add to Settings > Advanced > Code Injection > Header -->
<script>
(function() {
// Cookie consent code here
console.log('Cookie consent loaded');
})();
</script>
<!-- Add to Settings > Advanced > Code Injection > Footer -->
<script>
// Additional tracking scripts with consent checks
</script>Add banner directly to specific pages
<!-- Add to any page using Code Block -->
<div id="cookie-consent-banner">
<!-- Cookie banner HTML -->
</div>
<script>
// Cookie consent logic
document.addEventListener('DOMContentLoaded', function() {
initCookieConsent();
});
</script>
<style>
#cookie-consent-banner {
/* Custom styles */
}
</style>Advanced integration for developers
<!-- Add to template files -->
{squarespace-cookie-consent}
<!-- Custom template integration -->
<script>
window.Squarespace = window.Squarespace || {};
window.Squarespace.onInitialize = function() {
// Initialize cookie consent after Squarespace loads
initCookieConsent();
};
</script>Specialized for Squarespace Commerce
<!-- E-commerce specific integration -->
<script>
// Track e-commerce events with consent
function trackPurchase(orderData) {
if (hasConsent('analytics')) {
// Google Analytics Enhanced Ecommerce
gtag('event', 'purchase', {
transaction_id: orderData.id,
value: orderData.total,
currency: orderData.currency
});
}
}
// Listen for Squarespace Commerce events
Y.use('squarespace-commerce', function() {
// Initialize e-commerce tracking
});
</script>Get your Squarespace site compliant in 5 simple steps
Create your cookie consent banner using our builder:
Inject the code into your Squarespace site:
Set up consent-aware analytics:
Ensure everything works correctly:
Keep your compliance up to date:
Built specifically for Squarespace templates and functionality
Join thousands of Squarespace users using our cookie consent solution. Easy integration, professional results, and full compliance.