Unbounce
Add OnyxMetric analytics to your Unbounce landing pages
Unbounce's Script Manager applies a script to every page on a domain, including pages you publish later, so that is where the tag goes. To track a single Classic Builder page, use the page-level Javascripts dialog.
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 Unbounce
Custom scripts are not available on the Starter plan. You need Build or higher. Script Manager also needs a connected custom domain, so it does not apply to pages on the unbouncepages.com test domain.
- In the left menu, click Settings, then Script Manager.
- Click Add a Script, choose Custom Script, name it, and click Add Script Details.
- Set Placement to Head and Included on to All (main pages and confirmation dialogs).
- Paste the snippet into the editor.
- Tick the domains the script applies to on the right, then click Save Changes.
The script covers every page on those domains, including pages published later. If a page does not pick it up, republish that page.
- Open the page in the Classic Builder and click Javascripts at the bottom left.
- Name the script and set Placement to Head.
- Paste the snippet and click Done.
- Save, then Publish (or Republish). Custom scripts do not run in the builder or in Preview, only on the published page.
Smart Builder pages have no page-level script dialog, so use Script Manager for those.
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.
Track form submissions
Unbounce exposes window.ub.hooks, an unofficial hook that runs after a lead is recorded. Add this as a second Script Manager script (or page script) with placement Before Body End Tag to send a lead event:
<script>
window.ub.hooks.afterFormSubmit.push(function () {
if (window.onyx) {
window.onyx.event("lead", {
page: window.ub.page.name,
variant: window.ub.page.variantId
});
}
});
</script>window.ub.page.name, window.ub.page.variantId, and window.ub.page.id exist on every Unbounce page, so you can compare A/B variants in OnyxMetric with no other setup.
Troubleshooting
- Script runs twice: it is both in Script Manager and on an individual page. Remove the page-level copy.
- Nothing on
unbouncepages.com: Script Manager applies to custom domains only. Add the snippet at page level to test on the test domain. - Script Manager missing: the account is on Starter, which has no custom scripts.
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.