CookieConsentHQ

Integrations

Add CookieConsentHQ to your Squarespace site

Paste the CookieConsentHQ script into the Header field of Squarespace's Code Injection panel and save. Code injection is on the Core, Plus and Advanced plans and some legacy plans; checkout pages don't run custom code.

Get your install codeFree plan, no card needed.
Installation type
Script tag; not a Squarespace extension
Plans with code injection
Core, Plus, Advanced, some legacy plans
Code location
Code Injection, Header field
Checkout pages
Custom code not supported
Script loading
Without async or defer
Verification
Verify installation in the dashboard; free checker at /check

How do I add CookieConsentHQ to Squarespace?

Add CookieConsentHQ by pasting your installation script into Squarespace's site-wide Header code injection field. The installation uses a script tag, not a Squarespace extension.

  1. Open your CookieConsentHQ dashboard and select your site.
  2. Open the Install tab and copy the installation snippet.
  3. In Squarespace, open the Code Injection panel.
  4. Paste the snippet into the Header field.
  5. Click Save.

Your snippet looks like this, with your own site key:

<script src="https://cdn.cookieconsenthq.com/s/YOUR_SITE_KEY.js"></script>

Squarespace injects code from the Header field into the <head> element on every page. Code injection is available on the Core, Plus and Advanced plans and some legacy billing plans.

Squarespace also offers page-level Header code injection under a page's settings, in Advanced. Use the site-wide Header field for CookieConsentHQ so you don't have to add the script to each page separately.

See the installation documentation for the shared setup steps.

Where should the script appear in Squarespace?

The CookieConsentHQ script must be the first script in the published page's <head>, before analytics, advertising or other tracking scripts. It must load synchronously, so don't add async or defer.

CookieConsentHQ needs to run before trackers because it can't stop a script that has already run.

Squarespace places Header code injection inside <head>, but other code may still appear before your snippet. Check the published page rather than assuming the Header field gives the right order.

Yes. Turn off Squarespace's built-in cookie banner so visitors don't see two banners.

  1. Open Squarespace's Cookies & Data Privacy panel.
  2. Find the Cookie banner toggle.
  3. Turn it off.

Turning it off doesn't hand Squarespace's own cookies or built-in integrations to CookieConsentHQ. Those follow the settings in the Cookies & Data Privacy panel, so review them, including the non-essential cookies setting, when you switch.

Squarespace checkout pages don't support custom code, so CookieConsentHQ doesn't run on checkout.

How do I check that it works on Squarespace?

Use the Verify installation button in your CookieConsentHQ dashboard after saving the code injection change. It loads your homepage as a new visitor and checks:

  • that the script for your site is present;
  • that it's first in <head> and loads without async or defer;
  • that the banner appears;
  • that no analytics or marketing cookies are set before consent;
  • Google Consent Mode defaults;
  • that the live banner version is served.

You can also run the free checker on any page. It checks one page for cookies set before consent, hardcoded tracker tags and Consent Mode v2 defaults.

Mark scripts and embeds you add yourself with CookieConsentHQ attributes. For a marketing script, use:

<script type="text/plain" data-cchq="marketing" src="..."></script>

Use analytics or functional instead of marketing where that fits the script. A normal <script src> tag is stopped from running, but the browser may still fetch it early; type="text/plain" stops that request too.

For a marketing iframe, use:

<iframe data-cchq="marketing" data-cchq-src="..."></iframe>

To show your cookie list in page content, add <div data-cchq-cookie-table></div>. The cookie scanner fills the table. To let visitors reopen their choices, call CCHQ.showPreferences(), and look up individual choices in the consent log.

This page is technical installation guidance, not legal advice.

Questions

Which Squarespace plans support code injection?
Squarespace lists code injection on the Core, Plus and Advanced plans and some legacy billing plans.
Does the banner run on Squarespace checkout pages?
No. Squarespace checkout pages don't support custom code, so the CookieConsentHQ script doesn't load there.
Should I turn off Squarespace's own cookie banner?
Yes, so visitors don't see two banners. Squarespace's own cookies and built-in integrations still follow its Cookies & Data Privacy settings, so review those too.
Can I add the script to one page only?
Squarespace also has page-level Header code injection, but the banner belongs in the site-wide Header field so it loads on every page.