Website builders · 2 min setup

How to add analytics to Squarespace

To add VisitTrack to Squarespace, open Pages → Website Tools → Code Injection and paste the script tag into the Header field, then save. Squarespace injects Header code into the <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

  1. 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_ID below.

  2. Step 2: Open Code Injection

    In the Squarespace editor, go to Pages, scroll to Website Tools, and open Code Injection.

  3. 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>
  4. 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

  1. Open the public site and visit two or three pages.
  2. VisitTrack's live view shows you within seconds, and the Pages tab lists each page, including blog posts and product pages.
  3. View source and search for tracker.js to confirm the Header code is on the page.

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.

Code block
<!-- 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.

AttributeWhat it does
data-cookielessStore 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-localTrack on localhost and *.local — for testing an install only.
data-debugLog 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

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.