How to add a cookie consent banner to a Squarespace site
On Squarespace, paste the snippet in the Header field of Code Injection (open the Pages panel, click Custom Code at the bottom, then Code Injection), available on the Core, Plus and Advanced plans. Turn off Squarespace's own cookie banner under Cookies & Data Privacy and set Non-essential cookies to Restrict so Squarespace's analytics cookies stop; add your Google tag through code injection rather than the External API keys field.Steps
Where to paste the snippet in Squarespace
Squarespace's code injection prints custom HTML on every page. In the site editor, open the Pages panel, click Custom Code at the bottom of the panel, then Code Injection. Paste the snippet at the top of the Header field and click Save:
html<script src="https://cookiequiet.com/cq.js" data-site="YOUR_SITE_KEY" data-consent-mode="1" data-auto-block="1" defer></script>
Squarespace documents that the Header field is injected into the head of every page, and that code injection is available on the Core, Plus, Advanced and some legacy (Business and Commerce) plans. The Basic and Personal plans do not include it. Checkout pages do not run custom code.
Squarespace's own banner and analytics cookies
Squarespace ships its own cookie banner and its own analytics. Both need a setting change:
- Open the Cookies & Data Privacy panel (under Settings, then Website; older help articles call it Cookies & Visitor Data) and switch the Cookie banner toggle off, so visitors see one banner.
- Under Advanced Privacy settings, set Non-essential Cookies to Restrict and save.
The second step matters. Squarespace Analytics identifies visitors with its own cookies (ss_cid, ss_cpvisit, ss_cvr for two years; ss_cvisit, ss_cvt for 30 minutes). They are set by Squarespace's code, not by a tag you can mark, and Squarespace does not document any way for a third-party banner to switch them on after consent. With Restrict, Squarespace stops setting them for everyone; Squarespace Analytics then counts fewer visitors, which is the price of using an external banner on this platform. The necessary cookies (crumb, CART, Locked, _ssid, _dd_s) stay and belong under Necessary in your cookie table.
How to handle the tags Squarespace loads for you
- Google Analytics. The Measurement ID entered under Developer tools, then External API keys is printed by Squarespace, and Squarespace ties its consent handling to its own banner only (its help article says to work with your provider if you use a third-party consent platform). Remove the ID there and paste the Google tag in the Header field below the snippet, marked with
type="text/plain" data-cq-category="analytics", or preceded by Google's default consent block, as explained in the Google Analytics 4 guide. - Meta Pixel. Squarespace itself notes that its banner does not disable the Meta Pixel integration. Paste the pixel's base code in the Header field instead, marked
data-cq-category="marketing", as in the Meta Pixel guide. - Footer field. Code in the Footer field is injected before the closing body tag, after the snippet: marking works there too.
- Embeds. In a Code block or Embed block, write iframes with
data-cq-srcinstead ofsrcso the player waits for consent.
How to add the Cookie preferences link
Edit the footer, add a text link labelled "Cookie preferences" and set its link to #cq-preferences; Squarespace keeps anchor links as they are. If your layout makes that awkward, add a Code block containing <a href="#cq-preferences" data-cq-show-preferences>Cookie preferences</a>, or turn on the floating preferences button in the banner settings.
How to test
- Open the site in a private window and click Reject all.
- Check the cookies in the developer tools:
cq_consent,crumband other necessary cookies; no_ga, no_fbp, and noss_cvrif Restrict is on. - Clear the cookies, click Accept all, reload: the marked tags run.
- Open the consent log in the Cookiequiet dashboard.
If the site editor becomes hard to use after adding code, Squarespace lets you disable custom code while editing; that does not affect visitors.
What is specific to Squarespace
- Plan. Code injection needs Core or above (or a legacy Business or Commerce plan); on Basic or Personal, the snippet cannot be added.
- Checkout. Custom code does not run on checkout pages, so the banner is not shown there; commerce cookies are necessary.
- Squarespace Analytics. Expect fewer visitors in Squarespace's own reports once Non-essential cookies are restricted; the consent log and an analytics tag loaded after consent give you the real numbers.
- Version 7.0 and 7.1 both use the same Code Injection panel.