Add Antlytics to Eleventy
Prerequisites
- An Antlytics account (sign up free)
- Your tracking ID from Settings → Tracking Snippet in your Antlytics dashboard
Install the snippet
Open your base layout file — typically _includes/base.njk (Nunjucks), _includes/base.html (HTML), or _includes/base.liquid (Liquid) — and paste the snippet inside <head>:
Nunjucks (_includes/base.njk):
<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.
HTML (_includes/base.html):
The same snippet works identically in plain HTML layouts.
Liquid (_includes/base.liquid):
Also identical — Liquid layouts support raw <script> tags in <head>.
If your project uses a different base layout filename, open the file that wraps every page and add the snippet to its <head> section.
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.