Guide

Product analytics for developers

What a developer needs from product analytics: an SDK for each runtime you ship, autocapture so day one has data, one identify() call, a typed API, and a server you can run yourself. Here is how Pug covers each.

Start with autocapture, not a tracking sprint

The fastest way to kill an analytics rollout is to require a big instrumentation project before any data appears. Autocapture flips that: after one init(), the Web SDK records page views, clicks, scrolls, form submits, and rage and dead clicks. You get a usable event stream on day one and add explicit track() calls only for the domain events that matter: signup, purchase, and the like.

One person, not one device

The identity model is where product analytics earns its keep. Before sign-in, events accrue to an anonymous ID. When you call identify(userId), that history merges into a single profile, and traits like plan or email become filters across every report. The mechanics are covered in the how product analytics works; the practical point for developers is that you call identify() in one place (your auth callback) and the rest works across sessions and devices.

Seven SDKs, one per runtime

Pug ships seven SDKs today, one for each place events come from:

  • Web (TypeScript): autocapture, identity, and custom events in the browser.
  • Android (Kotlin): native app lifecycle, screen, and install events, callable from Java too.
  • iOS (Swift): the same lifecycle, install, and screen events, with a screen view for each view controller and .pugScreen("Products") to name a SwiftUI one; no runtime dependencies, added with Swift Package Manager.
  • Flutter (Dart): typed event methods for mobile apps.
  • Node (server-side): track server events, identify users, and read profiles and insights.
  • Go (server-side): the same server role for Go services, with typed properties, well-known events checked at compile time, and one client safe for concurrent use.
  • Ruby (server-side): the same server role for Rails and plain Ruby, thread- and fork-safe under Puma and Sidekiq.

A React Native SDK is in active development. You can see initialization for each on the SDKs page.

A typed API beside the dashboard

Pug’s API is Connect RPC, with a Protobuf schema for every request and response, so a private key lets your own services track events, identify users, fetch a profile, or run an insight query directly. That makes analytics data available to backend logic (onboarding flows, internal tools, billing) rather than trapped in a UI. The platform overview shows how ingest, the pipeline, and reads fit together.

Self-host because you’re the one who’ll run it

For developers, self-hosting is about control as much as privacy. Pug’s server is one Go binary, backed by PostgreSQL, ClickHouse, NATS JetStream, and Dragonfly (or any Redis 7+), which you can run yourself or swap for managed equivalents. The code is AGPL-3.0, so you can read exactly how events are processed. Start free on Pug Cloud, then move to your own infrastructure with the self-hosting setup guide when you’re ready. If you are weighing Pug against a broader platform, the PostHog alternatives roundup compares each PostHog product with a focused tool.

What makes product analytics developer-friendly?

A clean SDK with autocapture so you’re not hand-instrumenting everything, a simple identify() model for tying events to people, a typed API for reads and server-side tracking, and the option to self-host so you own the data and the deployment.

Which SDKs does Pug provide?

Seven today: Web (TypeScript/JavaScript), Android (Kotlin, callable from Java), iOS (Swift), Flutter (Dart), and three server-side SDKs: Node, Go, and Ruby. A React Native SDK is in active development. The server SDKs can also read profiles and run insight queries with a private key.

Do I have to instrument every event by hand?

No. The Web SDK autocaptures page views, clicks, scrolls, form submits, and rage/dead clicks after one init(). You add explicit track() calls only for domain events that matter, like signup or purchase.

Can I query analytics from my own backend?

Yes. With a private key, the Node, Go, or Ruby SDK can track events, identify users, fetch profiles, and run insight queries, so analytics data is available to your own services as well as the dashboard.

Built for developers

Web, Android, iOS, Flutter, Node, Go, and Ruby SDKs, a typed API, and self-hosting under AGPL-3.0. Free in the cloud up to 100k events a month.

Questions? Email hello@pug.sh