@intellize/tracker
v0.1.1
Published
Behavioral analytics for your website. One install, one line of code.
Maintainers
Readme
@intellize/tracker
Behavioral analytics for your website. One install, one line of code.
Captures server-side requests (including bots that don't run JavaScript) and rich client-side behavior — clicks, scroll depth, form interactions, web vitals, session replay, and more.
Install
npm install @intellize/trackerQuick Start
Express
import express from 'express';
import { createIntelizeMiddleware } from '@intellize/tracker/express';
const app = express();
app.use(createIntelizeMiddleware({ token: 'iz_your_token' }));Next.js
// middleware.ts
import { createIntelizeMiddleware } from '@intellize/tracker/next';
export const middleware = createIntelizeMiddleware({ token: 'iz_your_token' });Nuxt
// server/middleware/intellize.ts
import { defineIntelizeMiddleware } from '@intellize/tracker/nuxt';
export default defineIntelizeMiddleware({ token: 'iz_your_token' });That's it. No config in code — tracking settings are managed from the Intellize dashboard.
What It Tracks
| Feature | Description | |---|---| | Page Views | Page loads and SPA navigations (pushState/replaceState) | | Clicks | Every click with element selector, position, and text | | Rage Clicks | 3+ clicks in under 500ms on the same element | | Dead Clicks | Clicks that produce no DOM change | | Scroll Depth | Milestones at 25%, 50%, 75%, 100% | | Form Analytics | Field focus/blur timing, submit, and abandonment — never captures values | | JS Errors | Uncaught exceptions and unhandled promise rejections | | Web Vitals | LCP, FCP, CLS, INP, TTFB via PerformanceObserver | | Session Replay | DOM mutation recording (opt-in) | | Bot Detection | Identifies 50+ known bots (Googlebot, GPTBot, etc.) | | Server Requests | Logs every HTTP request server-side — catches bots that don't execute JS |
How It Works
The middleware does three things:
- Logs every server request — method, URL, user agent, IP, bot detection
- Sets a session cookie — links server and client events into one session
- Injects the tracker script — automatically added before
</body>in HTML responses
No manual script tags. No separate CDN. The client tracker is bundled and inlined automatically.
Size
8 KB client bundle (without replay). No external dependencies at runtime.
Configuration
All tracking settings are managed from the Intellize dashboard. The only code-side config is your token:
createIntelizeMiddleware({
token: 'iz_your_token', // required
configUrl: 'https://...', // optional — defaults to Intellize API
});License
MIT
