Setting up CookieOfficer on Squarespace
Adding the CookieOfficer code on the Squarespace platform.
On Squarespace, you add the CookieOfficer code through Code Injection, in the Header field. Setup takes a few minutes, but it requires a Business or Commerce plan, because this feature isn't available on lower plans. Below you'll find the instructions, as well as the things you should pay attention to before publishing.
The Squarespace panel is available in English only, so we give the names of its fields exactly as they appear there.
Before you start
- You should have a Business or Commerce plan. Code Injection is a paid feature, and you won't find it on the Personal plan.
- You have copied the code from the Installation page in the CookieOfficer panel. In the “Deployment method” section, choose “Code on the site”, then in the “Paste the code at the top of
<head>” card click “Copy” next to the “CookieOfficer script” block. - You have turned off the native Squarespace banner, if it was on. Two banners are mutually exclusive.
How do I add the CookieOfficer code to a Squarespace site?
- In the Squarespace panel, go to Settings.
- Open the Advanced section, then Code Injection.
- Paste the CookieOfficer code at the very beginning of the Header field, before any other scripts.
- Save your changes with the Save button.
The Header field inserts the code into the <head> section on all pages of the site. Don't use the Footer field or add the code to individual pages, because blocking will then only work after some of the scripts have already run.
How do I verify that the setup is correct?
Go back to the Installation page in the CookieOfficer panel and click “Verify now”. If it succeeds, you'll see the heading “Script detected and active”.
Also open your site in an incognito window and check whether the banner shows up. In a regular window your own decision is already saved, so the banner won't appear.
Finally, run a scan of your site in the panel and go to the Cookies page. There should be no message above the list of detected items about cookies and trackers running after a visitor has rejected consent.
If something on your site stops working after the setup, go to the Cookies page and, next to that provider's entry, switch “Block before consent” to “Not blocked”. Blocking of the other entries keeps working.
What should you pay particular attention to?
- Don't leave Squarespace's default banner turned on. A visitor will see two banners.
- Don't paste the code into the Footer field. Any scripts that run earlier will stay out of reach of automatic blocking.
- Don't add the code to individual pages. The banner should work across the whole site.
- Don't verify the setup in the editor preview. Code from Code Injection works on the published site.