Integration Guides
Weebly
Add OnyxMetric analytics to your Weebly site
Weebly (now part of Square) has site-wide Header Code and Footer Code fields under its SEO settings. Header code prints into the <head> of every page, so no theme 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 Weebly
- Open your site in the Weebly editor and go to Settings > SEO.
- Paste the snippet into Header Code and click Save.
- Click Publish. Header code reaches the live site only after you publish.
If your editor has no Settings tab, the same option is under Website > General Settings in the Square dashboard.
Each page also has its own Header Code box. That one is for page-specific code and is not needed here.
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
- Saved but not in the page source: click Publish after every change.
- Tag appears twice: it was added site-wide and on individual pages. Keep only the entry under Settings > SEO.
- Footer Code instead of Header Code: the footer works too, but it loads later and misses visitors who leave early.
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.