Add Sumly to a Squarespace site

Squarespace's code injection puts the line into the head of every page. Paste it into the Header box and save.

Drawn with an example line.

Step by step

  1. 1

    In Sumly, open Visitors and copy your project's line.

  2. 2

    In Squarespace, open Website › Website Tools › Code Injection and paste the line into Header.

  3. 3

    Save. Open the site in a private window and the visit shows on Visitors.

The whole line, as Sumly shows it with your own key.

<script defer src="https://sumly.dev/s.js" data-site="sl_your_key"></script>

Or let your coding assistant do it

Paste this into Claude Code, Cursor or Codex in your project. It fits the code to how your project is built, asks you for the dashboard steps and leaves the keys to you.

See what it says
Set up Squarespace for Sumly in this project.

Sumly (https://sumly.dev) shows revenue next to the visits and app users it came from. The full guide is https://sumly.dev/install/squarespace; read it if anything below is unclear.

Steps:
1. In Sumly, open Visitors and copy your project's line.
2. In Squarespace, open Website › Website Tools › Code Injection and paste the line into Header.
3. Save. Open the site in a private window and the visit shows on Visitors.

Header: The whole line, as Sumly shows it with your own key.
```
<script defer src="https://sumly.dev/s.js" data-site="sl_your_key"></script>
```

Keep in mind: Code injection needs the Core, Plus or Advanced plan (or some older plans). If the code ever upsets the editor's preview, turn on **Disable Scripts in Preview**; visitors are not affected. A page has its own header box too (page settings › Advanced). The site-wide one makes every page count.

How to work:
- Look at how this project is built first, and fit the code to its framework and its way of doing things; the examples above are a starting point, not something to paste as is.
- Steps that happen in a dashboard (Sumly, or Squarespace's own) are mine: tell me exactly what to click, then wait for me.
- Keys the code needs belong in environment variables, never in the code or the repository. Never ask me to paste a secret key into this chat; tell me which variable to set.
- Change only what this needs, show me the changes before you commit, and tell me how to check that it works.
- sl_your_key stands for the project's public key; it is on the Visitors page in Sumly. Ask me for it.

Consent

Squarespace's cookie banner has no documented way to tell a script you added that the visitor agreed. In the EU, the EEA, the UK and Switzerland Sumly counts visits without a cookie until sumly.consent(true) is called, so there visits count but payments are not traced to them.

Checkout

Squarespace's checkout pages do not run added code, so sales there are not traced to their visit. Stripe Payment Links on your pages do carry the visitor.

Your own domain

On Starter and Growth, one DNS record serves the script from your own address, past ad blockers: under Visitors › Add tracking › Your own address, enter one such as signal.your-site.com and add the CNAME it shows. If your checkout or app is on another domain, add it under Projects and payments › Other domains: the line then carries data-domains and one person stays one visitor across them.

Clicks and sections

Clicks on links to other sites count by themselves. Mark a button with data-sumly-event="signup" to count its clicks, and a section with data-sumly-scroll="pricing" to count the page views that reached it, a goal such as reached pricing.

Good to know

  • Code injection needs the Core, Plus or Advanced plan (or some older plans).
  • If the code ever upsets the editor's preview, turn on Disable Scripts in Preview; visitors are not affected.
  • A page has its own header box too (page settings › Advanced). The site-wide one makes every page count.

From Squarespace's own documentation, checked 4 November 2026: support.squarespace.com/hc/en-us/articles/205815908-Using-code-injection, support.squarespace.com/hc/en-us/articles/206545727-Providing-cookie-consent-options-with-a-banner .

Other platforms

Try it with your own projects

Sign in with Google or a code by e-mail and connect your first project. Free for one project, and 14 days of a paid plan with no card.

Start free

Or look around first: open the live demo.