Effortless Traffic Tracking for Next.js
A free, open-source solution using MongoDB to give you full ownership of your websites traffic data.

Why Choose Mongolytics?
Everything you need to understand your audience, and it's completely free.
Full transparency. Host it yourself, inspect the code, and contribute.
Built specifically for the Next.js framework for seamless integration.
Leverages the power and scalability of MongoDB for reliable data storage.
Get up and running in minutes with our straightforward setup guide.
You own your data. No third-party scripts or data sharing.
Get insights into your website's traffic and user behavior in real-time.
Get Started in Minutes
Integrate Mongolytics into your Next.js project with a few simple steps.
1. Install the package from NPM.
npm install @clipper-dev/mongolytics-next
2. Configure your environment variables.
# .env.local
MONGOLYTICS_URI="your-mongodb-atlas-connection-string"
MONGOLYTICS_DB_NAME="your-analytics-database-name"
3. Create the API endpoint.
// app/api/mongolytics/route.ts
import { mongolyticsAppRouteHandler as POST } from '@clipper-dev/mongolytics-next/server';
export { POST };
4. Add the tracking component to your root layout.
// app/layout.tsx
import { Mongolyth } from '@clipper-dev/mongolytics-next/client';
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<Mongolyth />
{children}
</body>
</html>
);
}