Antlytics Implementation Guides
This is the hub for all Antlytics implementation guides. Whether you are installing the tracking script for the first time, setting up the first-party proxy, or configuring conversion goals, find the right guide below.
Choosing your install method
Antlytics gives you three ways to install tracking on your site. The right one depends on your stack and your goals.
Method 1 — Script tag (any site, no package install)
The simplest method. Copy the snippet from your Antlytics dashboard (Settings → Tracking Snippet) and paste it into the <head> of every page you want to track. Works with any site — HTML, WordPress, Webflow, Squarespace, or any framework.
Best for: Sites where you can edit the HTML directly. No package manager required.
Method 2 — SDK component (Next.js, recommended)
Install the @antlytics/analytics package and add the <Analytics /> component to your Next.js layout. The SDK handles SPA navigation automatically.
npm install @antlytics/analytics
# or
pnpm add @antlytics/analytics
// app/layout.tsx
import { Analytics } from "@antlytics/analytics/next"
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<Analytics trackingId="your-uuid" />
</body>
</html>
)
}
Best for: Next.js App Router projects. See the full Next.js App Router guide.
Method 3 — First-party proxy (advanced, for ad-blocker resilience)
Route analytics requests through your own domain so they are indistinguishable from your own API traffic. Ad blockers cannot block same-origin requests.
Best for: Sites where accurate visitor counts matter and ad blockers affect a meaningful portion of your audience. See First-party proxy guide.
Framework-specific setup guides
| Framework | Guide |
|---|---|
| Next.js App Router | Next.js App Router |
| Quick start (any site) | Quick start |
| Plain HTML | Quick start |
| WordPress | WordPress |
| Webflow | Webflow |
| Astro | Astro |
| SvelteKit | SvelteKit |
First-party proxy
The first-party proxy is optional but improves data completeness. When your analytics requests go through your own domain, ad blockers cannot distinguish them from your own API traffic.
Set up the proxy in Next.js by creating a route handler:
// app/api/antlytics/pageview/route.ts
export { GET, OPTIONS, POST } from "@antlytics/analytics/proxy"
Then configure the SDK to use your domain:
<Analytics trackingId="your-uuid" apiHost="https://your-domain.com" />
Full instructions in the first-party proxy docs.
Setting up conversion goals
Conversion goals measure how many sessions reach an important page — a thank-you page, a signup confirmation, a pricing page. They use the pathname from pageviews you already send, so no extra tracking code is needed.
Go to Settings → Goals, enter the exact pathname (for example /thank-you), and save. The goal appears in your dashboard overview.
Full instructions in the conversion goals docs.
UTM campaign tracking
Antlytics reads UTM parameters from the current page URL automatically. Add UTM parameters to any link pointing at your site:
https://yoursite.com/blog/my-post?utm_source=newsletter&utm_medium=email&utm_campaign=april
The Campaigns breakdown in your dashboard shows traffic by UTM source, medium, and campaign name. No extra code required.
Full instructions in the UTM campaigns docs.
Exporting your data
Two ways to export analytics data:
- CSV export — available from the dashboard (check the roadmap for current availability).
- API — read your data programmatically via the API reference.
Troubleshooting common issues
No data appearing in my dashboard:
- Confirm your tracking ID matches the ID in your Antlytics dashboard.
- Check the browser network tab for a POST request to
/api/ingest/pageview. - Disable browser extensions that may block the request.
- Set up the first-party proxy for more reliable data.
Only seeing my own visits: Antlytics counts all pageviews, including your own. To exclude your traffic during development, install the tracking script only in production (use environment variables to gate the tracking ID).
Full troubleshooting steps in the troubleshooting guide.
Blog posts in this series
Detailed walkthroughs for specific implementation topics: