Leadpages
Add OnyxMetric analytics to your Leadpages landing pages
Every Leadpages page, site, and pop-up has an Analytics tab in its builder settings with a Head Section Tracking Code field. That is where the tag goes. In the site builder the setting is site-wide.
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 Leadpages
- Open the site or landing page in the builder.
- Click the Settings gear in the left sidebar, then the Analytics tab.
- Paste the snippet into Head Section Tracking Code.
- Click Save, then Update to push the change to the published page.
Repeat for each standalone landing page you want tracked. For sites, the code covers every page in the site.
Pop-ups have the same fields, but a pop-up shown on a page that already carries the snippet does not need its own copy.
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
- Not in the page source: the page was saved but not updated. Click Update to republish.
- Standalone pages missing: tracking code on a site does not extend to landing pages published outside it. Add the snippet to each one.
- GA4 Measurement ID field: the Analytics tab also has a field for a Google Analytics ID. That is for GA4 only. The OnyxMetric snippet goes in Head Section Tracking Code.
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.