Docs menuInstall CentPath › Install the script
Add CentPath to Squarespace
On this page
Add CentPath to your Squarespace site with code injection, so every page of your site counts its visits.
Before you start
Code injection is on the Core, Plus and Advanced plans, and on some older plans.
1. Copy your snippet
In CentPath, open your site, go to Setup → Install and click Copy. The snippet you copy holds your site's own id, so every visit counts for the right site:
<script>window.analytics = window.analytics || Object.assign([], { q: [], goal: function () { this.q.push(arguments); } });</script>
<script defer src="https://centpath.app/script/p.js" data-site-id="YOUR_SITE_ID"></script>2. Open Code Injection
- Open the Pages panel and scroll to its bottom.
- Click Code Injection: it's under Custom Code or Website Tools, depending on your site.
3. Paste it into the header
- Paste the snippet into the Header field. Code there goes into the
<head>of every page, so you paste it once. - Click Save.
Verify the setup
- Open your live site in a private window and load a page.
- In CentPath, look under the steps in Setup → Install: Waiting for your first pageview… turns into First pageview received. once the visit arrives.
- If it said First pageview received. before you started, your site has had visits already: look for this one in your dashboard instead. Reload it, and the visit shows in the Visits feed, usually within a minute.
Check your installation shows more ways to check a page.
Troubleshooting
You can't edit Code Injection
Your plan doesn't include code injection: see Before you start. On a plan without it, code you added stays in the panel but isn't added to your pages.