How to add code to header and footer on Squarespace.
How to Add Code to the Header and Footer in Squarespace
Need to install Google Analytics, a meta tag, or custom CSS? Adding code to your site's header or footer is simple with Squarespace's built-in Custom Code tool. Here’s how to do it in just a few steps:
1. Open the Custom Code Panel
From your Squarespace dashboard:
Click Pages in the left sidebar to access your site structure.
Scroll down the left panel until you find “Custom Code” (highlighted in red in your screenshot).
Click it to open the section where you can manage code injections.
Then find the ‘‘code injection’’ (highligthed in red in the second screenshot)
2. Add Header or Footer Code
In the Custom Code panel, you’ll see two main boxes:
Header: Paste any code that needs to go inside the
<head>
tag of your website (e.g., meta tags, font embeds, or verification codes).Footer: Paste any code that should load after the rest of the page (e.g., JavaScript snippets like Google Analytics or chatbot scripts).
3. Save Your Changes
After adding your code, scroll down and click “Save”. Your code will now be injected site-wide into either the header or footer, depending on where you placed it.
Tip: Squarespace doesn’t allow scripts in free plans. You need a Business or Commerce plan to use header/footer code injection.