Add Antlytics to Hexo
Prerequisites
- An Antlytics account (sign up free)
- Your tracking ID from Settings → Tracking Snippet in your Antlytics dashboard
Install the snippet
Locate your active theme's head partial. For the default Landscape theme this is themes/landscape/layout/_partial/head.ejs. Other themes use a similar path.
Paste the snippet just before the closing </head> tag in that file:
<script
defer
src="https://www.antlytics.com/tracker.js"
data-tracking-id="YOUR-SITE-ID"
data-api-host="https://www.antlytics.com"
></script>
Note: Replace
YOUR-SITE-IDwith the tracking ID from your Antlytics dashboard.
Using a custom theme or injecting without editing theme files
If you prefer not to modify theme files directly, Hexo supports injectors via scripts/inject.js in your project root:
// scripts/inject.js
hexo.extend.injector.register("head_end", function () {
return `<script defer src="https://www.antlytics.com/tracker.js" data-tracking-id="YOUR-SITE-ID" data-api-host="https://www.antlytics.com"></script>`;
});
This approach survives theme updates.
Verify installation
- Visit your site in a browser.
- Open your Antlytics dashboard → Overview.
- Your visit should appear within a few seconds.
If data does not appear after a few minutes, check the troubleshooting guide.
Optional: First-party proxy
To avoid ad blockers, set up a first-party proxy on your own domain.
Need help?
Email support@antlytics.com with your site ID and page URL.
Something missing? Get in touch and we will update these docs.