Integrations
SQSquarespace
implementation guidePlatforms and stores

Cookie banner for Squarespace with Google Consent Mode v2

Add the CookiePilot banner to a Squarespace site with header Code Injection. You paste the CookiePilot code at the top of the Header field and Google Analytics and GTM below it. You turn off the built-in Squarespace banner and replace the native Google Analytics connection with a tag below the stub.

Consent behaviour

Code in the Header field goes into the head of every page on the site.

You control the order in the field: CookiePilot at the top, GA4, GTM and other tags below it.

According to Squarespace's help, its banner does not block Code Injection code by itself. After switching to CookiePilot you turn it off, so there are not two banners.

Setup steps

In the CookiePilot panel, add the site's domain and copy the install code.

In Squarespace, open Pages → Website Tools → Code Injection and paste the code at the very top of the Header field. Code Injection is available on the Core plan and above.

If Google Analytics is connected through Developer tools → External API keys, remove the ID there and paste the GA4 or GTM tag into the Header field below the CookiePilot code.

In Cookies & Data Privacy, turn off the Squarespace Cookie banner. Squarespace warns that turning the banner off while cookie restriction is on can break some content, so review the site after the change.

Save and open the site in a private window. Check it using the checklist.

Platform limitations

Squarespace checkout pages do not support custom code, so the CookiePilot banner does not show at checkout. The code only runs again on the order confirmation and order status pages.

Squarespace's own cookies, including analytics ones, are set by the platform. CookiePilot does not block them.

Code Injection scripts also run in the editor preview. Test on the published site in a private window.

Example snippet

Example snippet
<script src="https://cdn.cookiepilot.io/stub.js"></script>
<script async src="https://cdn.cookiepilot.io/cookiepilot.js" data-cpkey="YOUR_SITE_KEY"></script>

Test checklist

In the page source, stub.js is the first Code Injection script in head.

The first dataLayer entry is consent default with denied values.

Only the CookiePilot banner shows on the page.

Before the visitor clicks there are no _ga, _gcl or _fbp cookies, and after Accept dataLayer contains consent update granted.

Related integrations

See the setups that most often appear together with this integration.

Ready to configure it?

Start CookiePilot, choose the right integration and verify that tags wait for user consent before they run.