Integration Guides
Teachable
Add OnyxMetric analytics to your Teachable school
Teachable adds tracking scripts through Code Snippets in the school admin. The Head Code Snippets section places code inside the <head> of every page of your school.
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 Teachable
- In the school admin, go to Site > Code Snippets.
- Paste the snippet into Head Code Snippets, which applies to all pages and all users.
- Click Save.
The Logged In Snippets and Logged Out Snippets sections limit code to one audience. Leave them empty so students and prospects are tracked alike.
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 Snippets missing from the Site menu: it needs the Builder plan or higher.
- Checkout and login pages not tracked: head snippets do not apply to SSO login or checkout pages served from
sso.teachable.com. Pages on your school domain, including the course area, are covered. - Snippet in a lesson's Custom HTML block: that block affects one lesson only. Use Code Snippets for site-wide tracking.
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.