The video is in the works. Until then, the guide will get you there.
Step-by-step guide
What you need for this
- A paid Squarespace plan. "Code Injection" is a premium feature. You get it on the Core and Advanced plans, and depending on how old your account is, it may also be called Professional, Business, Commerce, or Premium. On the Basic plan (formerly Personal), the menu item is missing entirely, and there is no way around that.
- Your tracking code. You get it under Tracking code with one click on "Copy".
- Access to your Squarespace account with administrator rights. As a contributor with limited rights, you will not see this area.
Selecting your website
Sign in to Squarespace and pick the website you want to measure. You land in the dashboard, meaning the management area of your website.
On the left, click "Website".
A submenu opens. Click "Pages" there.
Pages settings
At the very bottom of the Pages settings, click "Custom Code" on the left.
A submenu opens. Click "Code Injection" there.
You land on the "Code Injection" page. You will recognize it by the two large text fields titled "Header" and "Footer".
Pasting in the tracking code
Click into the upper "Header" field and paste your tracking code there. The field is allowed to contain other code already. Just add yours underneath without deleting anything.
Saving
Click "Save" in the top left. Only then is the code stored.
If your website is already publicly reachable, that was the last step. The code is active on all pages right away, no additional publishing is needed. If your website is still set to private or was never launched, switch it to public first. Before that, nobody can be counted because nobody can get there.
Checking
Now the moment of truth, and it takes less than two minutes:
- Open your website in a new browser window.
- Click through a few pages.
- Switch to the Real-time report in Trustlytics.
- Within a few seconds, your own visit should show up there.
If something is there, everything is installed correctly. If it stays empty, the section below will help.
When nothing gets counted
Six causes cover almost every case:
| Cause | What to do |
|---|---|
| Not saved | The most common case. Open "Code Injection" again. If the "Header" field is empty, the save did not go through. Paste the code and click "Save" in the top left. |
| Code in the Footer instead of the Header | Cut it and put it into the upper "Header" field. Then save once more. |
| Only tested the preview | Open your website at its proper address in the browser, not through the editor. |
| Website not public yet | As long as your website is private or password protected, no real visits happen. |
| Cookie banner blocks scripts | If you use the Squarespace cookie banner and tied custom scripts to consent, Trustlytics only loads for visitors who clicked. Trustlytics sets no cookies and does not need that link. Take it out. |
| Wrong address registered | The code only works on the website listed in your Trustlytics account. Check that under Website. |
If you still see nothing after that, reload your website with Ctrl + F5 (on a Mac, Cmd + Shift + R). Squarespace and your browser keep pages cached for a while, and then you are still looking at the old version without the code.
Common questions
Do I need a paid Squarespace plan?
Yes. "Code Injection" is only available starting with the Core and Advanced plans, sometimes also called Professional, Business, Commerce, or Premium. On the Basic plan (formerly Personal), the menu item is missing.
I cannot find "Code Injection" in the Pages settings. What is going on?
Usually it comes down to one thing: you have a Basic plan, and then the feature does not exist at all. To be sure, click the search icon (the magnifying glass) at the top of the dashboard and type "Code Injection". If the search finds something, click on it, and you land directly on the right page. If it finds nothing, an upgrade might be worth a look.
Do I have to paste the code into every page individually?
No. Whatever is in the "Header" field, Squarespace puts into the head section of every page of your website. New pages, blog posts, and product pages are included automatically.
Header or Footer, what is the difference?
The header loads before the page content, the footer only after. Every second counts for the measurement. Anyone who leaves a page quickly is simply not recorded when the code sits in the footer. That is why it goes in the header.
Do I have to republish my website afterward?
Not for a website that is already public. Saving is enough, the change is live immediately. Only if your website has not been launched yet do you need to take care of that first.
There is also a field for individual pages. Should I use that?
No. For Trustlytics that would be the wrong spot, because you would have to repeat it on every page and every time you create a new one.
Do my visitors need a cookie banner now?
No. Trustlytics works without cookies. Your visitors do not have to click anything away or confirm anything. If you already use the Squarespace cookie banner, please do not tie our code to consent. Otherwise, you will be missing all the visitors who did not click.
Can I remove the code later?
Yes. Open "Code Injection", delete the Trustlytics section from the "Header" field and click "Save". From then on, nothing is measured anymore.
Will my website get slower because of it?
No. The script is tiny and loads in the background without holding up the rest of your page.