Install
Add analytics and revenue attribution to Squarespace
Squarespace calls this Code Injection, it lives in Settings → Advanced, and it needs a Business plan or higher. Once it's in, the interesting work is connecting the site's actual purpose — bookings, orders, enquiries — to the channels that produced them.
Paste the snippet into Code Injection
Settings → Advanced → Code Injection → Header. Paste the tag and save. This applies site-wide. Code Injection requires a Business plan or higher; on Personal plans the field isn't available.
Settings → Advanced → Code Injection → Header<script defer src="https://revtrail.pyln.dev/track.js" data-site="SITE_KEY"></script>Track form and booking conversions
Squarespace forms and Acuity booking embeds both end in a confirmation state. Add a submit listener in the Footer injection field so enquiries and bookings register as goals rather than disappearing into the pageview count.
Settings → Advanced → Code Injection → Footer<script> document.addEventListener("submit", function (e) { if (e.target && e.target.tagName === "FORM") { window.revtrail && window.revtrail("enquiry"); } }); </script>Confirm it's receiving
Open your site in a normal browser tab, then check Realtime in the Revtrail dashboard — your own visit should appear within a few seconds. If nothing arrives, the usual causes are a mistyped site key, an ad blocker on your own browser, or a Content-Security-Policy that blocks the script origin.
Commerce orders
Squarespace Commerce has its own order-confirmation page injection. Fire a named event there for the conversion, and take the verified amount from the Stripe webhook where your payments settle through Stripe.
What Squarespace Analytics already covers
Traffic, popular content, sales totals, and basic referrer breakdowns — genuinely useful, and included. What it doesn't do is follow a visitor from a first click through to a purchase weeks later, or tell you the lifetime value of customers from a given channel. If you're spending on ads or sponsorships, that's the number that decides your budget.
Testing without polluting your own data
You'll spend a lot of time on your own site while editing it. Open the opt-out URL from your Revtrail dashboard once in your editing browser — it records only the opt-out choice, never an identifier — so your own visits stop inflating a small site's numbers.
Questions people actually ask
- Which Squarespace plan do I need?
- Business or higher. Code Injection isn't available on Personal plans, and there's no way around that from our side.
- Will this slow down my Squarespace site?
- The tag is deferred and about 3KB gzipped, so it doesn't block rendering. Squarespace's own scripts are considerably heavier.
- Do I need a cookie banner for this?
- Not for Revtrail. The default identity is a daily rotating hash — no cookies, no persistent identifier, nothing stored on the device. If you run ad pixels or other analytics that do use cookies, their obligations are unchanged.
- Will this slow my site down?
- The script is deferred, so it never blocks rendering, and it's about 3KB over the wire gzipped. It fires one beacon per pageview.
Install guides