Add Antlytics to Angular
Prerequisites
- An Antlytics account (sign up free)
- Your tracking ID from Settings → Tracking Snippet in your Antlytics dashboard
Install the snippet
Open src/index.html and paste the snippet inside <head>:
<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.
This file is the single HTML entry point for your Angular application. The hosted tracker loads once and captures Angular Router navigation via History API patches and popstate — no additional setup.
Angular Universal (SSR)
If you use Angular Universal for server-side rendering, the snippet in src/index.html is included in the server-rendered HTML. The tracker fires on the client after hydration, which is the correct behaviour.
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.