Integration Guides
Squarespace
Add OnyxMetric analytics to your Squarespace site
Squarespace injects custom HTML into every page through its Code Injection panel, so no template edits are needed.
Copy your tracking snippet
In OnyxMetric, open your site's Site Settings and copy the tracking script. It looks like this:
<script src="https://app.onyxmetric.com/api/script.js?siteId=YOUR_SITE_ID" async></script>YOUR_SITE_ID is the numeric ID of your site.
Add the snippet to Squarespace
Code Injection is available on the Business and Commerce plans, not on Personal.
- From the Home Menu, open Settings.
- Open Website, then Code Injection (under Advanced or Developer, depending on your version).
- Paste the snippet into the Header field. The tag is async, so it does not delay page rendering.
- Click Save at the top of the panel.
The Footer field also works. Leave Lock Page and Order Confirmation Page alone, since those apply to single pages only.
Check that it works
Load your live site and click through a few pages. Pageviews show up in the OnyxMetric dashboard within seconds.
If nothing arrives:
- View the page source and search for
script.js?siteId=to confirm the tag is present. - In the browser's Network tab, check that
script.jsreturns200and that requests go to/api/track. - Turn off ad blockers, or proxy the script through your own domain.
- Read script troubleshooting for other causes.
Troubleshooting
- Code Injection missing from Settings: the site is on the Personal plan. Upgrade to Business or Commerce.
- Only checkout is tracked: the snippet went into Order Confirmation Page instead of Header or Footer.
Next steps
- Track custom events such as signups, purchases, and clicks.
- Identify users to tie sessions to accounts.
- Proxy the script through your own domain to get past ad blockers.
- Script attributes let you skip or mask URLs and tag events.