Installation guides
Install on Wix or Squarespace
On this page
Both builders have a site-wide head code setting. Custom code generally requires a paid plan and, on Wix, a connected domain.
Wix
Open Settings → Custom code
In your site dashboard, open Settings and find Custom code under the advanced settings.
Add custom code
Replace
YOUR_SITE_IDwith the public site ID from your site's Settings → Install card. The site ID is public and safe in browser code; never put your secret key in a page.Custom code<script defer src="https://metricraven.com/js/script.js" data-site-id="YOUR_SITE_ID" ></script>Apply it to All pages, choose to load it once rather than on each new page, and place it in the Head. The tracker records later page changes itself.
Publish and open your site
Open a page on your connected domain.
Squarespace
Open Code Injection
Find Code Injection in your site's settings (under the advanced or developer options).
Paste the snippet into the Header field and save
Replace
YOUR_SITE_IDwith the public site ID from your site's Settings → Install card. The site ID is public and safe in browser code; never put your secret key in a page.Header<script defer src="https://metricraven.com/js/script.js" data-site-id="YOUR_SITE_ID" ></script>Open your live site
Check a page on your public domain while logged out of the editor.
Verify it works
Open your live website in a normal browser window (not an automated or embedded one). In the browser's Network panel, look for script.js and then a request to /api/v1/collect whose response contains ok: true. Open your site's Traffic tab and choose Refresh; the selected dates must include your visit.
Nothing showing? See Troubleshooting.
Notes
- Use the site-wide head code setting, not an embed or HTML widget: widgets that place code inside an iframe are ignored by the tracker.
- Only hostnames listed in your site's Settings → Site domains (and their subdomains) are accepted. To also count visits on a platform address such as
your-site.wixsite.com, add it there; otherwise those requests are refused withdomain_not_allowed. - The editor and its previews may load pages inside a frame, which the tracker ignores.
- If you use a cookie banner, connect it with Consent & visitor IDs.
Optional script attributes are listed in Install & verify. To exclude your own visits, see Exclude your visits.