Website builders · 2 min setup
How to add analytics to Squarespace
<head> of every page, so one paste covers the whole site.Updated
Code Injection is available on the Core, Plus and Advanced plans and some legacy plans. It doesn't run on Squarespace's checkout pages — which matters for revenue (see below), but not for traffic analytics on the rest of your site.
Squarespace at a glance
- Where the tag goes
- Pages → Website Tools → Code Injection → Header
- Plans
- Core, Plus, Advanced (and some legacy plans)
- Per page
- Page settings → Advanced → page header code (optional)
- Checkout pages
- Code isn't supported there
- Conversions
- Form block post-submit redirect + page goal
How to install VisitTrack on Squarespace
Step 1: Copy your site id
Add your Squarespace domain as a site in VisitTrack and copy the snippet from the install step. Replace
SITE_IDbelow.Step 2: Open Code Injection
In the Squarespace editor, go to Pages, scroll to Website Tools, and open Code Injection.
Step 3: Paste the tag into Header and save
Paste it into the Header field (not Footer — loading early means quick visits are still counted) and click Save.
Code Injection → Header<script defer data-site="SITE_ID" src="https://visitrack.app/tracker.js"></script>Step 4: Visit your live site
Open your site's public URL in a browser where you're logged out of Squarespace (or a private window), and browse a few pages.
How to check VisitTrack is working on Squarespace
- Open the public site and visit two or three pages.
- VisitTrack's live view shows you within seconds, and the Pages tab lists each page, including blog posts and product pages.
- View source and search for
tracker.jsto confirm the Header code is on the page.
Does VisitTrack track Squarespace page navigation?
Squarespace 7.1 sites load each page as a full page load, and each one is a pageview. On older 7.0 templates with Ajax loading turned on, page changes happen in place through the History API — the tracker follows those too, so there's nothing to configure either way.
How to track custom events and goals in Squarespace
The no-code route is a page goal: in a Form block's settings, set the post-submit action to redirect to a thank-you page (for example /thanks), then create a page goal for /thanks in VisitTrack's Settings → Goals. Every completed form becomes a conversion with its source.
Squarespace buttons can't take custom attributes, but a Code block can hold your own HTML, where data-vt-goal and data-vt-scroll work. Automatic events also record outbound clicks, mailto:/tel: clicks and downloads.
<!-- In a Code block -->
<a href="/consultation" data-vt-goal="consultation_click">
Book a consultation
</a>Revenue attribution on Squarespace
Squarespace Commerce checkout runs on Squarespace's own pages, where custom code doesn't run and which VisitTrack can't read, so store orders aren't attributed. If you sell with Stripe Payment Links from your Squarespace pages instead, connect Stripe in VisitTrack and add the Payment Link snippet from Stripe revenue attribution to the Footer field — each payment is then credited to the source that brought the buyer.
Script options you might need on Squarespace
All optional — add them to the same tag. Full reference: script configuration.
| Attribute | What it does |
|---|---|
data-cookieless | Store nothing in the browser; the server derives a daily-rotating id. See cookieless mode. |
data-exclude="/app/*" | Never track these paths (comma-separated, * wildcard). Checked on every navigation. |
data-allow-local | Track on localhost and *.local — for testing an install only. |
data-debug | Log every event the script sends, and why it skipped one, to the console. |
data-auto="false" | Turn off automatic events (downloads, contact clicks, form submits, rage clicks, JS errors, 404s). |
Squarespace troubleshooting
Code Injection isn't in your menu
Your plan doesn't include it. Code Injection needs Core, Plus or Advanced (or a legacy plan that includes it).
Your own editing shows up as visits
Open the public site once with ?vt_ignore=1 in the URL to exclude that browser, or add your office IP in VisitTrack's Settings → Exclusions.
Counts look doubled
The tag is in Code Injection and in a Code block or a page's own header injection too. Keep only the site-wide copy.
No conversions from forms
Check the Form block redirects to the exact path you used in the page goal, including any trailing segment.
Squarespace analytics FAQ
Where is Code Injection in Squarespace 7.1?
In the editor under Pages → Website Tools → Code Injection. Paste analytics into the Header field, which is output inside <head> on every page.
Which Squarespace plans support code injection?
Core, Plus and Advanced, plus some legacy billing plans, as of October 2026. The entry-level Basic plan doesn't include it, so scripts can't be added site-wide there.
Can VisitTrack track Squarespace form submissions?
Yes. Make the form redirect to a thank-you page after submit and create a page goal for it in VisitTrack's Settings → Goals.
Does VisitTrack track Squarespace Commerce sales?
Not as attributed revenue — Squarespace's checkout doesn't run custom code and isn't a supported payment provider. You still see which sources bring visitors to product pages.
Do I need a cookie banner on Squarespace with VisitTrack?
Not if you use cookieless mode, which stores nothing in the browser. Standard mode keeps a first-party id that generally needs consent in the EU/UK. General information, not legal advice.
Keep going
- Wix analyticsAdd VisitTrack to Wix in Settings → Custom Code: All pages, Head, load once — Wix's client-side page changes are tracked automatically.
- Webflow analyticsAdd VisitTrack to Webflow in Site settings → Custom code → Head code, then publish — plus custom attributes for goals and Stripe Payment Link revenue.
- Ghost analyticsAdd VisitTrack to Ghost in Settings → Code injection → Site header (every Ghost(Pro) plan and self-hosted) and count confirmed member signups.
- WordPress analyticsAdd VisitTrack to WordPress with a header-code plugin or a wp_head hook — works with block themes, caching plugins and WooCommerce.
- Install the tracking scriptThe reference tag, CSP notes and how to check it's working.
- Custom events and signupsvisitrack(), data-vt-goal, scroll events and server-side signups.
- Use casesHow SaaS teams, indie hackers, stores and agencies use VisitTrack.
- VisitTrack vs Google AnalyticsCookie-free analytics with revenue attribution, compared honestly.
Add VisitTrack to your Squarespace site
Cookie-free analytics with revenue attribution, live visitors, funnels and session replays. One script tag, every feature on every plan. 14 days free, no card required.
Not on Squarespace? See all 29 integration guides.