Skip to main content
CDP · INFRASTRUCTURE

Real-Time Event Tracking

JavaScript SDK + server-side API. 6ms ingestion on ClickHouse. Real-time segmentation from every event.

No credit card required · All 4 services included

Why event tracking is the foundation

Without events, marketing is guessing. "Which feature drove retention?" / "What content converts?" / "When do users drop off?" all require observable behavior, not self-reported surveys.

Event tracking is just logging user actions with context. Page viewed. Button clicked. Cart updated. Subscription upgraded. Each event has a name, a user, a timestamp, and properties.

Two ways to send events

Client-side: JavaScript SDK

Drop a script tag on your website. Call monfri.track('event_name', { property: value }) from anywhere in your code. Handles sessionization, page-view tracking, click tracking, and form submission automatically.

Server-side: REST API

POST events directly from your backend. Use for sensitive events (purchases, subscription changes) where you don't want client-side spoofing risk.

Both paths hit the same pipeline and are indistinguishable downstream.

The ingestion pipeline

  1. Event arrives at our edge (Cloudflare-routed)
  2. Validated against basic schema (event name, user ID or anonymous ID)
  3. Queued to Redis Stream (~1ms latency)
  4. Processed by BullMQ workers: identity resolution, trait computation, bot detection
  5. Inserted into ClickHouse (columnar analytics database) — 6ms median
  6. Segments recalculated if event affects any active segment criteria
  7. Webhooks fired for subscribed event types
  8. Real-time broadcast via Socket.IO for live dashboard updates

From event-received to dashboard-visible: typically under 100ms end-to-end.

Why ClickHouse

PostgreSQL is great for transactional data (user accounts, orders) but struggles with billions of events. ClickHouse is a columnar analytics database purpose-built for high-volume event ingestion and aggregation queries.

In our benchmarks:

  • PostgreSQL event insert: ~972ms median (bottleneck at scale)
  • ClickHouse event insert: ~6ms median (162× faster)
  • Aggregation query (events last 30 days by user): PostgreSQL 14 seconds, ClickHouse 340ms

This is why Segment, Amplitude, Mixpanel all run on ClickHouse (or similar columnar stores) — it's the right tool for the job.

Bot detection (4 layers)

Bots inflate your numbers and corrupt your segments. Monfri filters them at 4 layers:

  1. SDK-side: checks for headless browser flags (Puppeteer, Playwright, etc.)
  2. User agent patterns: known bot strings (crawlers, scrapers) are rejected
  3. Burst detection: unusual click rates in short windows flag a session
  4. IP rate limiting: same IP making 1000+ events/minute is sandboxed

Bot-flagged events are logged but excluded from segments, analytics, and billable event counts.

Schema and tracking plan

Monfri auto-discovers your event schema (event names, property keys, value types). Use it to:

  • Validate new code is sending consistent schemas
  • Generate documentation for your team
  • Spot-check cardinality (too many unique values = likely bug)

If you're migrating from Segment, we accept Segment's tracking-plan.json directly.

Limits by plan

  • Starter: 50K tracked events/month
  • Growth: 1M tracked events/month
  • Scale: 10M tracked events/month

Overages are charged at €12 per 50K events (ex. VAT, no hard cutoff).

Try Real-Time Event Tracking

Included in every Monfri plan. 14-day free trial of Growth — no credit card.

Start free trial →