Brass flow meter on copper pipes counting glass marbles that collect in an orderly tray, a metaphor for measuring software adoption

Feature Adoption Tracking: Event Schema, Pipeline and Metrics

•11 min read

When a company rolls out new software, someone eventually asks a simple question: are people actually using it? Answering it with confidence requires feature adoption tracking designed into the product, not a dashboard bolted on after launch. This guide covers the engineering side: the event schema, how to capture events without losing or duplicating them, a data model that answers adoption questions in plain SQL, and the failure modes and privacy risks you need to plan for.

If you own the people side of the rollout (role-based sessions, a sandbox, internal champions), start with our step-by-step guide to training employees on new software. This article is about the system that tells you whether that training worked.

Define adoption before you write a single event

"Adoption" is not one number. Write each definition down as a query before you instrument anything, because the definitions decide which events you need.

  • Activation: the user performed the feature's core action at least once.
  • Repeat use: the user performed the core action in N distinct weeks out of the last M. Pick N and M per feature; a month-end report and a daily order screen have different natural rhythms.
  • Breadth: the share of eligible users who activated. The denominator is the users whose role gives them access to the feature, not every account in the system.
  • Depth: completion of the full flow, not just opening the screen. "Invoice Sent" tells you more than "Invoice Page Viewed".
  • Time to first use: the time between a user getting access (or attending training) and activation.

Every definition hangs off a core action: one business event per feature that proves real use. Page views are a weak proxy; anchor your metrics on actions that change state.

Designing the event schema for feature adoption tracking

Segment's tracking plan best practices are a solid default: an Object + Action structure for event names (for example "Order Created"), Title Case for event names, snake_case for property names, and no events created to track what should be properties. "Order Created" with a channel property beats separate "Order Created From Mobile" and "Order Created From Web" events.

Wrap every event in the same envelope:

{
  "event_id": "0b6f3c1e-8f0a-4c4e-9a52-2f1d7e3b9a10",
  "event": "Order Created",
  "schema_version": 3,
  "occurred_at": "2025-01-15T14:03:22.120Z",
  "received_at": "2025-01-15T14:03:22.480Z",
  "account_id": "acc_481",
  "user_id": "usr_9921",
  "role": "sales_rep",
  "feature_key": "quick_order",
  "environment": "production",
  "source": "server",
  "app_version": "2.14.0",
  "properties": { "channel": "mobile", "line_items": 4 }
}

Why each field earns its place:

  • event_id is generated where the event originates (a UUID). It is your deduplication key for every retry downstream.
  • occurred_at and received_at are both kept. Client clocks drift; the server timestamp is the one you trust for ordering and lateness checks.
  • account_id makes the data multi-tenant from day one, even if you only have one tenant today.
  • role is a snapshot at event time. Roles change, and joining to the current users table rewrites history.
  • feature_key is a stable identifier, ideally the same key as your feature flag, so rollout cohorts and usage join cleanly.
  • environment separates production, sandbox and training traffic (more on this below).
  • source records whether the event came from the server, the client or a backfill.

Keep the tracking plan in the repository as one JSON Schema per event, review changes in pull requests, and validate payloads both in CI and at ingestion.

Three capture architectures and their trade-offs

1. Client-side SDK sending to an analytics vendor. Fast to set up, and the only way to see UI-only behavior such as tours completed or help panels opened. The costs: ad blockers, closed tabs and flaky networks drop events, the data lives outside your database, joining it with business tables needs an export pipeline, and it is easy to leak personal data through automatically captured properties.

2. Server-side events emitted by your application. Authoritative, because the event is recorded where the business action commits, and it lands next to the data you will join it with. The costs: no visibility into interactions that never reach the server, and each event takes deliberate engineering work.

3. Deriving usage from domain tables. If orders.created_by and an audit log already exist, you can compute activation with no new instrumentation, even retroactively. The costs: it only covers actions that persist, it couples analytics to your schema, and it cannot see abandoned flows.

A pragmatic combination: core actions server-side, domain tables for backfills, and client events only for UI-only signals, treated as best-effort lower bounds.

Capturing server-side events without losing or duplicating them

The classic bug is the dual write. Commit to the database and then publish to a queue, and a crash in between loses the event. Publish first, and a rolled-back transaction leaves a phantom event. The fix is the transactional outbox: write the event row in the same transaction as the business change, and let a separate relay deliver it.

await db.transaction(async (tx) => {
  const order = await tx.orders.insert(input);
  await tx.outbox.insert({
    event_id: crypto.randomUUID(),
    event: "Order Created",
    feature_key: "quick_order",
    account_id: ctx.accountId,
    user_id: ctx.userId,
    role: ctx.role,
    environment: config.environment,
    occurred_at: new Date(),
    properties: { channel: input.channel, line_items: input.items.length },
  });
  return order;
});

The relay claims rows in batches, so several workers can run without stepping on each other:

BEGIN;
SELECT * FROM outbox
WHERE delivered_at IS NULL
ORDER BY id
LIMIT 500
FOR UPDATE SKIP LOCKED;
-- deliver the batch to the events store or queue
UPDATE outbox SET delivered_at = now() WHERE id = ANY($1);
COMMIT;

If delivery succeeds but the commit fails, the batch is sent again. That is at-least-once delivery, so the consumer must be idempotent:

INSERT INTO events (event_id, occurred_at, event, feature_key, ...)
VALUES ($1, $2, $3, $4, ...)
ON CONFLICT (event_id, occurred_at) DO NOTHING;

At-least-once delivery plus an idempotent insert gives you effectively-once results. If your events live in the same PostgreSQL instance as your business data, start even simpler: insert directly into the events table inside the business transaction and skip the relay. Add a queue only when volume or additional consumers justify it.

Data model: raw events plus daily rollups

Raw events grow forever, while most adoption questions are "per user, per feature, per day". Store both.

CREATE TABLE events (
  event_id     uuid        NOT NULL,
  event        text        NOT NULL,
  feature_key  text        NOT NULL,
  account_id   text        NOT NULL,
  user_id      text        NOT NULL,
  role         text        NOT NULL,
  environment  text        NOT NULL,
  source       text        NOT NULL,
  occurred_at  timestamptz NOT NULL,
  received_at  timestamptz NOT NULL DEFAULT now(),
  properties   jsonb       NOT NULL DEFAULT '{}',
  PRIMARY KEY (event_id, occurred_at)
) PARTITION BY RANGE (occurred_at);

CREATE TABLE feature_usage_daily (
  day          date NOT NULL,
  account_id   text NOT NULL,
  user_id      text NOT NULL,
  role         text NOT NULL,
  feature_key  text NOT NULL,
  event_count  int  NOT NULL,
  PRIMARY KEY (day, account_id, user_id, feature_key)
);

Range partitioning by month (see the PostgreSQL table partitioning documentation) keeps indexes small and turns retention into dropping old partitions instead of running large deletes. Note that the primary key includes occurred_at: on a partitioned table, PostgreSQL requires unique constraints to include the partition key columns. The trade-off is that a duplicate carrying a different occurred_at would slip through, so generate the timestamp once, at the source, together with the ID, and reuse both on every retry.

Rebuild the rollup for recent days with an idempotent job so late events are absorbed. Pick one reporting time zone and use it explicitly:

INSERT INTO feature_usage_daily
SELECT (occurred_at AT TIME ZONE 'UTC')::date, account_id, user_id,
       max(role), feature_key, count(*)
FROM events
WHERE environment = 'production'
  AND occurred_at >= current_date - 3
GROUP BY 1, 2, 3, 5
ON CONFLICT (day, account_id, user_id, feature_key)
DO UPDATE SET event_count = EXCLUDED.event_count, role = EXCLUDED.role;

Queries that answer adoption questions

Activation rate by role, with eligible users as the denominator:

SELECT u.role,
       count(DISTINCT f.user_id)::numeric / count(DISTINCT u.user_id) AS activation_rate
FROM users u
LEFT JOIN feature_usage_daily f
  ON f.user_id = u.user_id AND f.feature_key = 'quick_order'
WHERE u.account_id = 'acc_481'
  AND u.role IN ('sales_rep', 'manager')
GROUP BY u.role;

Time to first use after training, joining a training_attendance table (user_id, session_id, attended_at):

SELECT t.session_id,
       count(*) AS activated_attendees,
       percentile_cont(0.5) WITHIN GROUP (
         ORDER BY first_use.day - t.attended_at::date
       ) AS median_days_to_first_use
FROM training_attendance t
JOIN LATERAL (
  SELECT min(f.day) AS day
  FROM feature_usage_daily f
  WHERE f.user_id = t.user_id
    AND f.feature_key = 'quick_order'
    AND f.day >= t.attended_at::date
) first_use ON first_use.day IS NOT NULL
GROUP BY t.session_id;

Report alongside it how many attendees never activated; that number matters as much as the median.

Repeat use, here defined as at least three active weeks out of the last eight:

SELECT user_id, count(DISTINCT date_trunc('week', day)) AS active_weeks
FROM feature_usage_daily
WHERE feature_key = 'quick_order'
  AND day >= current_date - 56
GROUP BY user_id
HAVING count(DISTINCT date_trunc('week', day)) >= 3;

Keep sandbox and training traffic out of production metrics

Training sandboxes generate bursts of realistic-looking events. If they land in the same tables unmarked, launch week looks like a success that never happened. Set environment from server configuration, never from the client, flag sandbox tenants in the accounts table, and filter on both in every rollup. Do not throw sandbox data away, though: whether a user practiced in the sandbox is a useful variable when you analyze who activated in production.

Failure handling and data quality

  • Client events: queue in memory, send in batches, and flush with navigator.sendBeacon when the page is hidden (see the MDN reference for sendBeacon). Still treat client counts as lower bounds.
  • Clock skew: order and window by received_at, and reject or clamp client occurred_at values that are implausibly far from it.
  • Schema drift: validate at ingestion and route invalid payloads to a quarantine table. Silent drops hide bugs for weeks.
  • Missing instrumentation: backfill from domain tables with source = 'backfill', so you can always tell measured data from reconstructed data.
  • Instrumentation regressions: alert when a core event's daily volume falls to zero after a deploy. That usually points to a broken emitter, not to users abandoning the feature.

Privacy and security

  • Use internal IDs in events, never emails, names or phone numbers, and never put free-text user input in properties.
  • Enforce tenant isolation in the analytics layer too, with row-level security or a mandatory account_id filter, especially if customers see their own adoption dashboards.
  • Define retention: raw events for a limited window, rollups for longer. Partitions make this cheap.
  • Design for deletion requests: deleting by user_id must reach raw events, rollups and any exported copies.
  • Give analysts read access to views, not to raw tables, and check the data protection rules of every country where your users are.

When users are distributors, not employees

In network marketing companies, many of the people who need to adopt new tools are independent distributors, not staff. You cannot make training mandatory, so adoption data is often the only feedback you get. The model above carries over directly: role becomes rank or distributor type, and the core actions are things like orders placed or new contacts registered in the back office. If you are evaluating a network marketing platform, ask how it exposes this data per rank and per feature; ask the same of any custom software for internal operations you commission.

Common mistakes

  • Measuring page views instead of core actions.
  • Using all users as the denominator instead of eligible users.
  • Joining to the current role instead of the role at event time.
  • Encoding values in event names ("Report Exported PDF", "Report Exported CSV").
  • Mixing sandbox and production traffic.
  • Dual writes without an outbox, or retries without an idempotency key.
  • Instrumenting after launch, which leaves no data for the first weeks.

Implementation checklist

  1. Write each adoption metric as a SQL query before instrumenting.
  2. Pick one core action per feature and name it Object + Action.
  3. Define the envelope and a JSON Schema per event; validate in CI.
  4. Emit core actions server-side, in the same transaction as the business change.
  5. Make every consumer idempotent on event_id.
  6. Partition raw events by month and build an idempotent daily rollup.
  7. Set environment on the server and filter sandbox traffic.
  8. Add volume alerts per core event.
  9. Strip personal data, set retention and test a deletion request end to end.
  10. Ship instrumentation before the training sessions start, not after.

Frequently asked questions

Should I build feature adoption tracking or buy an analytics tool?

Many teams do both: a vendor for UI-level behavior and exploration, and server-side events in their own database for the core actions that feed reporting. The deciding factors are whether you need to join usage with business data, where the data is allowed to live, and how much you can rely on client-side capture.

Do I need Kafka or another queue to start?

No. If events and business data share a PostgreSQL database, writing events in the same transaction gives you consistency with no extra infrastructure. Introduce a queue when volume, multiple consumers or a separate analytics store make the operational cost worth it.

How do I measure whether training improved adoption?

Record attendance with timestamps and compare time to first use and repeat use between users who attended and users who did not, within the same role. Treat the result as an indication rather than proof, because attendees may differ from non-attendees in other ways.

Comments

No comments yet. Be the first to share what you think.

Leave a comment

It is never published.