CookieFrameDocs

Squarespace Integration

Add a cookie consent banner to your Squarespace site using Code Injection in the Advanced settings

Squarespace Integration

CookieFrame integrates with Squarespace through the Code Injection feature in Advanced settings. You paste a single script tag into the header injection field — no plugins or custom development required.

Prerequisites

Before you begin, make sure you have:

  • A CookieFrame account with your domain added
  • A Squarespace site on a Business, Commerce Basic, or Commerce Advanced plan — Code Injection is not available on Personal plans
  • Your 8-character Domain ID from the CookieFrame Dashboard

Code Injection is a Squarespace feature available on Business-tier plans and above. If you are on a Personal plan, you will need to upgrade before you can add custom scripts.

Finding Your Domain ID

  1. Log in to your CookieFrame Dashboard
  2. Select your domain from the list
  3. Go to SettingsIntegration
  4. Your Domain ID is shown at the top (8 uppercase characters, e.g., A1B2C3D4)

Installation

Step 1 — Open Advanced Settings

In your Squarespace admin panel, go to SettingsAdvancedCode Injection.

Step 2 — Add the Script to the Header

In the Header field, paste the CookieFrame script tag:

<script src="https://cookieframe.com/api/widget/YOUR_DOMAIN_ID/script.js" async></script>

Replace YOUR_DOMAIN_ID with your 8-character Domain ID from the CookieFrame Dashboard.

Place this script before any other tracking scripts in the Header field. This ensures CookieFrame establishes consent before analytics or marketing scripts run.

The script is lightweight (~23KB gzipped) and is served through Cloudflare's CDN, so the async attribute is recommended.

Step 3 — Save

Click Save at the top of the Code Injection page. The script is now injected into every page of your site.


Verification

  1. Open your Squarespace site in an incognito / private window (to start without existing consent)
  2. The CookieFrame consent banner should appear on the first visit
  3. Open browser DevTools → Console and look for [CookieFrame] log messages to confirm the widget loaded
  4. Accept or reject cookies and verify that your choice is respected on subsequent visits

GDPR requires you to let visitors change their cookie preferences at any time. Add a Cookie Preferences link to your Squarespace footer or privacy page.

In Squarespace, add a Code Block to your footer or page and paste:

<a href="#" data-cookieframe="preferences">Cookie Preferences</a>

CookieFrame automatically attaches the click handler — no JavaScript needed. You can also add this inline in the Footer Code Injection field if you prefer to keep all custom code in one place.


Troubleshooting

  1. Confirm you clicked Save after adding the script in Code Injection
  2. Verify the Domain ID is exactly 8 characters and uppercase
  3. Check that the domain in CookieFrame matches your Squarespace site URL
  4. Open browser DevTools → Console and check for errors starting with [CookieFrame]
  5. Clear your browser cache and test in a fresh incognito window

"Code Injection not available" message

Code Injection requires a Business plan or higher. Check your Squarespace plan under AccountBilling.

Place the CookieFrame <script> tag at the top of the Header Code Injection field, before any other scripts. If you use Squarespace's built-in analytics or third-party integrations, enable Auto Block Scripts in your CookieFrame Dashboard under SettingsBehavior.

Another CMP is conflicting

Squarespace has a built-in cookie banner on some plans. Disable it under SettingsCookies & Visitor Data before activating CookieFrame to avoid two banners appearing simultaneously.

Changes not reflected on the live site

After saving Code Injection changes, hard-refresh your browser (Cmd+Shift+R / Ctrl+Shift+R) or test in a fresh incognito window to bypass any cached page state.


Need Help?