Integration Guides
Hostinger Website Builder
Add OnyxMetric analytics to your Hostinger Website Builder site
Hostinger Website Builder has a Custom code integration that adds code to every page. Script tags go at the end of <body> by default, and a data-render-head attribute moves them into <head>.
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 Hostinger Website Builder
- Open your site in the builder, click the more menu (three dots) at the top to open website settings, then choose Integrations.
- Select Custom code.
- Paste the snippet with
data-render-headadded so it loads from<head>:
<script src="https://app.onyxmetric.com/api/script.js?siteId=YOUR_SITE_ID" async data-render-head></script>- Save, then click Update website to publish. Custom code runs on the live site and in preview, not in the editor.
Without data-render-head, the tracker still works from the end of <body>. The attribute just makes it load earlier.
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
- No
script.jsrequest in the editor: expected. Integrations are injected into the published site only. Check the live URL or the preview. - Saved but not in the page source: click Update website after saving.
- Site breaks with several snippets: paste them one after another, never nested. If the page still fails, remove all custom code, update, and add them back one at a time.
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.