---
title: "How to measure feature retention in Node.js"
description: "Instrument feature completion in Node.js, send a controlled test history, and verify Day 1 and Day 7 feature retention in Amplitude."
canonical: "https://amplitude.com/build/nodejs-feature-retention"
---

# How to measure feature retention in Node.js

Instrument feature completion in Node.js, send a controlled test history, and verify Day 1 and Day 7 feature retention in Amplitude.

Source: https://amplitude.com/build/nodejs-feature-retention

---

# How to measure feature retention in Node.js

Track report-builder completion with the Amplitude Node.js SDK, then verify repeat use in a Retention Analysis chart. In about 30 minutes, you'll check Day 1 and Day 7 results against a controlled fixture.

- Node.js 24
- JavaScript
- Analytics SDK 1.5.83
- 30 min

Chris Tam · Last updated 17 November 2026

Node.js services can record when someone successfully completes a feature's main action. Amplitude's [product analytics](https://amplitude.com/amplitude-analytics) uses those events to measure whether people return to that feature after their first use.

In this tutorial, you'll instrument report creation, generate a small simulated usage history, and verify Day 1 and Day 7 retention. I'll use four test users with known return patterns so you can check the chart's arithmetic.

## What you'll build

A Node.js report-builder simulation that sends ten timestamped `Build Retention Report Created` events. Four people first use `report_builder`; two return on Day 1 and one returns on Day 7. The chart should show 50% Day 1 retention and 25% Day 7 retention with Return On selected.

This is a script with simulated report completions and historical timestamps. It doesn't create reports, authenticate people, or measure real customer adoption. I'll include a repeated report from Bob and a `dashboard` feature action from Dana to test the chart's counting and filters.

## Prerequisites

- Node.js 24.14 or later, Corepack, and a terminal.
- A dedicated Amplitude test project where you can send ten synthetic historical events.
- Its API key from **Settings > Projects > your project > General > Manage** next to **API Key**, and its US or EU data center.

A free Amplitude account is enough for this tutorial; retention is available on all plans. [Sign up for free](https://app.amplitude.com/signup) to create your project.

For optional background, see [product analytics in Node.js](https://amplitude.com/build/nodejs-product-analytics). Everything needed for this example is below. In an existing service, merge the event helper into your instrumentation and preserve authentication, routes, event names, and SDK initialization.

## 1. Set up the Node.js project

I'll install the package documented in the [Node.js SDK reference](https://amplitude.com/docs/sdks/analytics/node/node-js-sdk), pinned to the version tested here. Start in a new folder.

Terminal

```sh
mkdir amplitude-feature-retention
cd amplitude-feature-retention
mkdir src tests
```

package.json

```json
{
  "name": "amplitude-nodejs-feature-retention",
  "version": "1.0.0",
  "private": true,
  "type": "module",
  "packageManager": "pnpm@10.33.2+sha512.a90faf6feeab71ad6c6e57f94e0fe1a12f5dcc22cd754db40ae9593eb6a3e0b6b12e3540218bb37ae083404b1f2ce6db2a4121e979829b4aff94b99f49da1cf8",
  "engines": {
    "node": ">=24.14.0",
    "pnpm": ">=10.21.0"
  },
  "scripts": {
    "demo": "node --env-file-if-exists=.env.local src/demo.js",
    "test": "node --test tests/*.test.mjs"
  },
  "dependencies": {
    "@amplitude/analytics-node": "1.5.83"
  }
```

pnpm-workspace.yaml

```yaml
minimumReleaseAge: 10080
trustPolicy: no-downgrade
```

.gitignore

```text
node_modules/
.env.local
```

Terminal

```sh
corepack pnpm install
```

Commit the generated `pnpm-lock.yaml`. Later installs use `corepack pnpm install --frozen-lockfile`. The [public example](https://github.com/amplitude/ampli-examples/tree/c951a1ac98d19bfa9031738baf88808cfbec50a0/node/javascript/feature-retention) includes the tested lockfile and all source files.

## 2. Define a completed feature action

I use one event with `feature_name` and `usage_stage` properties. `first_use` identifies the cohort entry; `repeat_use` identifies a later completion. These are properties chosen for this example, not reserved Amplitude fields.

src/analytics.js

```javascript
import { createInstance, Types } from '@amplitude/analytics-node';

export function reportEvent({ userId, reportId, firstUse, occurredAt = Date.now(),
  feature = 'report_builder', runId }) {
  if (typeof userId !== 'string' || userId.length < 5) throw new Error('Use a stable user ID of at least five characters.');
  if (typeof firstUse !== 'boolean') throw new Error('firstUse must come from saved application state.');
  if (!Number.isSafeInteger(occurredAt) || occurredAt <= 0) throw new Error('occurredAt must be epoch milliseconds.');
  if (!reportId || !runId) throw new Error('reportId and runId are required.');
  return {
    event_type: 'Build Retention Report Created', user_id: userId,
    device_id: `build-device-${userId}`, insert_id: `${runId}:${reportId}`,
    time: occurredAt,
    event_properties: { feature_name: feature,
      usage_stage: firstUse ? 'first_use' : 'repeat_use', demo_run_id: runId },
  };
}

export async function createAnalytics({ apiKey, serverZone = 'US', transportProvider } = {}) {
  if (!apiKey) throw new Error('Set AMPLITUDE_API_KEY before sending.');
  if (!['US', 'EU'].includes(serverZone)) throw new Error('Use US or EU for AMPLITUDE_SERVER_ZONE.');
  const client = createInstance();
  await client.init(apiKey, {
    serverZone, flushQueueSize: 100, flushIntervalMillis: 1000,
    flushMaxRetries: 0, requestTimeoutMillis: 5000, logLevel: Types.LogLevel.None,
    ...(transportProvider ? { transportProvider } : {}),
  }).promise;
  return { async send(events) {
    const pending = events.map(event => client.track(event).promise);
    await client.flush().promise;
    const results = await Promise.all(pending);
    const failures = results.filter(result => result.code !== 200);
    if (failures.length) throw new Error(`${failures.length} upload(s) failed; first code ${failures[0].code}.`);
    return results.length;
  } };
}
```

In your service, call `reportEvent()` after the report creation commits. Pass a stable signed-in user ID, the committed report's ID, and whether that person has used the feature before. Determine first use from durable per-user, per-feature application state, including concurrent requests; this helper validates the supplied value but doesn't calculate it. A browser refresh or process restart mustn't mark a returning person as a first-time user.

`occurredAt` defaults to the current timestamp. The fixture will override it with known historical times. Use actual occurrence times when adapting the helper to real actions. The prefixed device ID is synthetic identity for this isolated fixture; preserve your app's established identity scheme when merging instrumentation.

**Why.** Retention depends on who did the action and when. Preserve the same `user_id` across first and repeat use, and send `time` in milliseconds since epoch. The fixture's stable `insert_id` distinguishes each completion; resending the same event with the same device and insert IDs supports Amplitude's seven-day deduplication window.

The sender initializes one client, starts a flush, and checks every event's result code. `flush().promise` resolves to `void`; it doesn't establish successful delivery. This demo uses zero retries and a five-second upload idle timeout. Use your production delivery policy and handle analytics errors separately from an already-completed report creation.

## 3. Create a history with known returns

I'll give all four people their first report ten days ago. Alice returns on Days 1 and 7, Bob creates two reports on Day 1, Carol returns on Day 2, and Dana uses the other feature on Day 1.

src/fixture.js

```javascript
import { reportEvent } from './analytics.js';

export const DAY = 24 * 60 * 60 * 1000;

export function createFixture(runId, now = Date.now()) {
  const start = new Date(now);
  start.setUTCHours(12, 0, 0, 0);
  const dayZero = start.getTime() - 10 * DAY;
  const events = [];
  const add = (person, day, firstUse, feature = 'report_builder') => {
    events.push(reportEvent({ userId: `build-retention-${person}-${runId}`,
      reportId: `report-${events.length + 1}`, firstUse,
      occurredAt: dayZero + day * DAY, feature, runId }));
  };
  for (const person of ['alice', 'bob', 'carol', 'dana']) add(person, 0, true);
  add('alice', 1, false);
  add('alice', 7, false);
  add('bob', 1, false);
  add('bob', 1, false); // Two reports by one person still count as one returning user.
  add('carol', 2, false);
  add('dana', 1, false, 'dashboard'); // Other-feature activity isn't a report-builder return.
  return { runId, cohortDateUTC: new Date(dayZero).toISOString().slice(0, 10),
    expected: { cohortUsers: 4, returnOnDay1: '50%', returnOnDay7: '25%',
      returnOnOrAfterDay1: '75%' }, events };
}
```

The four first-use events happen at the same time. That gives the chart one entry cohort and leaves every user enough time to reach Day 7. Each new run uses separate synthetic users and a separate `demo_run_id`.

The fixture intentionally places the other-feature event under the same event name. Filtering both chart events to `feature_name = report_builder` keeps Dana's dashboard activity out of report-builder retention.

## 4. Preview and send the fixture

Create the runner and the environment file. Its default is a dry run that prints the ten events; only `--send` initializes the SDK and uploads them.

src/demo.js

```javascript
import { randomUUID } from 'node:crypto';
import { createAnalytics } from './analytics.js';
import { createFixture } from './fixture.js';

const args = process.argv.slice(2);
if (args.some(arg => arg !== '--send')) throw new Error('Only --send is supported.');
const fixture = createFixture(randomUUID());
const { events, ...summary } = fixture;
if (!args.includes('--send')) {
  console.log(JSON.stringify({ mode: 'dry-run', ...summary, events }, null, 2));
} else {
  try {
    const analytics = await createAnalytics({ apiKey: process.env.AMPLITUDE_API_KEY,
      serverZone: process.env.AMPLITUDE_SERVER_ZONE || 'US' });
    const uploadsAccepted = await analytics.send(events);
    console.log(JSON.stringify({ mode: 'sent', ...summary, uploadsAccepted }, null, 2));
  } catch (error) {
    console.error(error.message);
    process.exitCode = 1;
  }
```

.env.example

```text
AMPLITUDE_API_KEY=
AMPLITUDE_SERVER_ZONE=US
```

Terminal

```sh
cp .env.example .env.local
corepack pnpm demo
```

Paste your test project's key into `.env.local`, and use `EU` or `US` for its region. After checking the dry-run output, send the fixture once:

Terminal

```sh
corepack pnpm demo --send
```

Save the printed `runId` and `cohortDateUTC`. A successful run reports `uploadsAccepted: 10`. The printed percentages are fixture expectations; the next step checks whether Amplitude's processed results match them.

## 5. Build the feature-retention chart

Open **Retention Analysis** and set the date range to **Last 30 Days**. Use `Build Retention Report Created` as both the starting event and the return event. Apply these filters to the individual events using **+ Filter by**:

Chart configuration

```text
Starting event: Build Retention Report Created
  demo_run_id is the printed runId
  feature_name is report_builder
  usage_stage is first_use

Return event: Build Retention Report Created
  demo_run_id is the same runId
  feature_name is report_builder
  usage_stage is repeat_use

Measure: Return On
Interval: daily
Day definition: rolling 24-hour windows
Count: users
Date range: Last 30 Days
```

Put the feature and run filters on both events. Segment-level filters apply to the starting event, so they aren't a substitute for specifying the return action. The `usage_stage` start filter also keeps repeat completions from creating additional entry cohorts.

Use daily **Return On** with rolling 24-hour windows, Amplitude's default day definition. Day 1 covers hours 24 up to, but not including, hour 48 after the start, with daily timestamps rounded down to the hour. The fixture places returns at exact hour boundaries. Strict calendar dates use the chart's time zone, so keep the specified day definition for this comparison.

Check the chart and breakdown table:

- **Cohort users**. **Expected result:** 4 **Why:** Alice, Bob, Carol, and Dana each have one first use
- **Return On, Day 1**. **Expected result:** 50% **Why:** Alice and Bob return; Bob's second report doesn't add another person
- **Return On, Day 2**. **Expected result:** 25% **Why:** Carol returns
- **Return On, Day 7**. **Expected result:** 25% **Why:** Alice returns
- **Return On or After, Day 1**. **Expected result:** 75% **Why:** Alice, Bob, and Carol return on Day 1 or later

Switch to **Return On or After** for the last row, then switch back. Carol is included in that Day 1 result because she returns on Day 2. Dana remains excluded because her later action belongs to `dashboard`.

**MCP.** If your agent uses [Amplitude's MCP server](https://amplitude.com/mcp), ask it to inspect the project's event and property names before querying this run. Keep `demo_run_id` and the first/return filters explicit in its analysis.

## Verify it worked

Verify the processed data after the upload acknowledgement:

1. **Terminal.** The dry run prints ten events and sends nothing. The explicit send prints one run ID and `uploadsAccepted: 10`.
2. **User Profiles.** Open [User Lookup](https://amplitude.com/docs/analytics/debug-analytics) and search for `build-retention-alice-` followed by your run ID. Inspect her three events: one `first_use`, then `repeat_use` one and seven days later. Use an activity date range that includes the historical events.
3. **Other users.** Bob has two repeat reports on Day 1. Carol returns on Day 2. Dana's later event has `feature_name: dashboard`, so it mustn't qualify as a report-builder return.
4. **Processed retention.** With the matching run and feature filters on both events, check four starters, 50% Return On Day 1, and 25% Return On Day 7. The Return On or After Day 1 result is 75%.

The fixture establishes that your instrumentation and chart agree on a controlled dataset. Replace simulated actions with real completions before interpreting feature retention for your customers.

## Troubleshooting

### The chart shows zero starters

The events are historical. Include the printed cohort date in the chart range and use the run ID from the sent run. A dry run doesn't send data, and its ID differs from the next invocation's ID.

### Day 1 shows 75% instead of 50%

Check whether **Return On or After** is selected. For exact-day retention, use **Return On**. Also confirm the return event's feature filter: including Dana's other-feature action changes the answer.

### The denominator grows after people return

Check the start event's `usage_stage: first_use` filter. Then check that your service marks first use from durable application state. Repeated starting events can create additional retention entry intervals.

### Later days are incomplete

In real data, recent starters haven't had time to reach Day 7. Amplitude excludes incomplete intervals from overall totals. The fixture's starters are ten days old so its Day 7 comparison is complete.

### The script prints an upload failure

Check the test key, region, and result code. A completed flush doesn't guarantee acceptance. Local tests below include a rejected-upload path so failures don't look like successful sends.

## Full code reference

These are the complete application, configuration, and test files. The public example also includes the generated lockfile. The tests use the installed SDK with a local transport; the chart checks verify the live service separately.

package.json

```json
{
  "name": "amplitude-nodejs-feature-retention",
  "version": "1.0.0",
  "private": true,
  "type": "module",
  "packageManager": "pnpm@10.33.2+sha512.a90faf6feeab71ad6c6e57f94e0fe1a12f5dcc22cd754db40ae9593eb6a3e0b6b12e3540218bb37ae083404b1f2ce6db2a4121e979829b4aff94b99f49da1cf8",
  "engines": {
    "node": ">=24.14.0",
    "pnpm": ">=10.21.0"
  },
  "scripts": {
    "demo": "node --env-file-if-exists=.env.local src/demo.js",
    "test": "node --test tests/*.test.mjs"
  },
  "dependencies": {
    "@amplitude/analytics-node": "1.5.83"
  }
```

pnpm-workspace.yaml

```yaml
minimumReleaseAge: 10080
trustPolicy: no-downgrade
```

.gitignore

```text
node_modules/
.env.local
```

.env.example

```text
AMPLITUDE_API_KEY=
AMPLITUDE_SERVER_ZONE=US
```

src/analytics.js

```javascript
import { createInstance, Types } from '@amplitude/analytics-node';

export function reportEvent({ userId, reportId, firstUse, occurredAt = Date.now(),
  feature = 'report_builder', runId }) {
  if (typeof userId !== 'string' || userId.length < 5) throw new Error('Use a stable user ID of at least five characters.');
  if (typeof firstUse !== 'boolean') throw new Error('firstUse must come from saved application state.');
  if (!Number.isSafeInteger(occurredAt) || occurredAt <= 0) throw new Error('occurredAt must be epoch milliseconds.');
  if (!reportId || !runId) throw new Error('reportId and runId are required.');
  return {
    event_type: 'Build Retention Report Created', user_id: userId,
    device_id: `build-device-${userId}`, insert_id: `${runId}:${reportId}`,
    time: occurredAt,
    event_properties: { feature_name: feature,
      usage_stage: firstUse ? 'first_use' : 'repeat_use', demo_run_id: runId },
  };
}

export async function createAnalytics({ apiKey, serverZone = 'US', transportProvider } = {}) {
  if (!apiKey) throw new Error('Set AMPLITUDE_API_KEY before sending.');
  if (!['US', 'EU'].includes(serverZone)) throw new Error('Use US or EU for AMPLITUDE_SERVER_ZONE.');
  const client = createInstance();
  await client.init(apiKey, {
    serverZone, flushQueueSize: 100, flushIntervalMillis: 1000,
    flushMaxRetries: 0, requestTimeoutMillis: 5000, logLevel: Types.LogLevel.None,
    ...(transportProvider ? { transportProvider } : {}),
  }).promise;
  return { async send(events) {
    const pending = events.map(event => client.track(event).promise);
    await client.flush().promise;
    const results = await Promise.all(pending);
    const failures = results.filter(result => result.code !== 200);
    if (failures.length) throw new Error(`${failures.length} upload(s) failed; first code ${failures[0].code}.`);
    return results.length;
  } };
}
```

src/fixture.js

```javascript
import { reportEvent } from './analytics.js';

export const DAY = 24 * 60 * 60 * 1000;

export function createFixture(runId, now = Date.now()) {
  const start = new Date(now);
  start.setUTCHours(12, 0, 0, 0);
  const dayZero = start.getTime() - 10 * DAY;
  const events = [];
  const add = (person, day, firstUse, feature = 'report_builder') => {
    events.push(reportEvent({ userId: `build-retention-${person}-${runId}`,
      reportId: `report-${events.length + 1}`, firstUse,
      occurredAt: dayZero + day * DAY, feature, runId }));
  };
  for (const person of ['alice', 'bob', 'carol', 'dana']) add(person, 0, true);
  add('alice', 1, false);
  add('alice', 7, false);
  add('bob', 1, false);
  add('bob', 1, false); // Two reports by one person still count as one returning user.
  add('carol', 2, false);
  add('dana', 1, false, 'dashboard'); // Other-feature activity isn't a report-builder return.
  return { runId, cohortDateUTC: new Date(dayZero).toISOString().slice(0, 10),
    expected: { cohortUsers: 4, returnOnDay1: '50%', returnOnDay7: '25%',
      returnOnOrAfterDay1: '75%' }, events };
}
```

src/demo.js

```javascript
import { randomUUID } from 'node:crypto';
import { createAnalytics } from './analytics.js';
import { createFixture } from './fixture.js';

const args = process.argv.slice(2);
if (args.some(arg => arg !== '--send')) throw new Error('Only --send is supported.');
const fixture = createFixture(randomUUID());
const { events, ...summary } = fixture;
if (!args.includes('--send')) {
  console.log(JSON.stringify({ mode: 'dry-run', ...summary, events }, null, 2));
} else {
  try {
    const analytics = await createAnalytics({ apiKey: process.env.AMPLITUDE_API_KEY,
      serverZone: process.env.AMPLITUDE_SERVER_ZONE || 'US' });
    const uploadsAccepted = await analytics.send(events);
    console.log(JSON.stringify({ mode: 'sent', ...summary, uploadsAccepted }, null, 2));
  } catch (error) {
    console.error(error.message);
    process.exitCode = 1;
  }
```

tests/retention.test.mjs

```javascript
import test from 'node:test';
import assert from 'node:assert/strict';
import { reportEvent, createAnalytics } from '../src/analytics.js';
import { createFixture, DAY } from '../src/fixture.js';

test('fixture has four starters, distinct Day 1/7 returns and a negative control', () => {
  const { events } = createFixture('local-run', Date.parse('2026-11-17T20:00:00Z'));
  const start = events[0].time;
  const first = events.filter(e => e.event_properties.usage_stage === 'first_use');
  const repeats = events.filter(e => e.event_properties.usage_stage === 'repeat_use'
    && e.event_properties.feature_name === 'report_builder');
  const users = list => new Set(list.map(e => e.user_id)).size;
  assert.equal(users(first), 4);
  assert.equal(users(repeats.filter(e => e.time === start + DAY)), 2);
  assert.equal(users(repeats.filter(e => e.time === start + 7 * DAY)), 1);
  assert.equal(users(repeats.filter(e => e.time >= start + DAY)), 3);
  assert.equal(events.filter(e => e.event_properties.feature_name === 'dashboard').length, 1);
  assert.equal(new Set(events.map(e => e.insert_id)).size, 10);
});

test('real SDK preserves historical timestamps and per-event properties', async () => {
  const received = [];
  const transportProvider = { async send(_url, payload) {
    received.push(...structuredClone(payload.events));
    return { status: 'success', statusCode: 200, body: {
      eventsIngested: payload.events.length, payloadSizeBytes: 0, serverUploadTime: Date.now() } };
  } };
  const analytics = await createAnalytics({ apiKey: 'local-test-key', transportProvider });
  const { events } = createFixture('local-run');
  assert.equal(await analytics.send(events), 10);
  assert.deepEqual(received.map(e => [e.user_id, e.device_id, e.insert_id, e.time, e.event_properties]),
    events.map(e => [e.user_id, e.device_id, e.insert_id, e.time, e.event_properties]));
});

test('bad configuration and rejected uploads fail visibly', async () => {
  await assert.rejects(createAnalytics(), /AMPLITUDE_API_KEY/);
  await assert.rejects(createAnalytics({ apiKey: 'local', serverZone: 'invalid' }), /US or EU/);
  assert.throws(() => reportEvent({ userId: 'alice', reportId: 'r1', runId: 'run' }), /firstUse/);
  const analytics = await createAnalytics({ apiKey: 'local-test-key', transportProvider: {
    async send() { return { status: 'invalid', statusCode: 400, body: { error: 'Rejected by test' } }; },
  } });
  await assert.rejects(analytics.send(createFixture('local-run').events), /400/);
});
```

Terminal

```sh
corepack pnpm test
```

## Hand it to your agent

Use this prompt to adapt the instrumentation while preserving the checks.

Implementation prompt

```text
Implement https://amplitude.com/build/nodejs-feature-retention in this Node.js app.
Preserve authentication, routes, existing SDK initialization, and established event names.
Send a feature-completed event after the business action commits. Use the same stable
user_id for first and repeat completion. Derive first use from durable per-user,
per-feature state, with concurrency handled by the application, not browser state.
Include feature_name and usage_stage on each event. Use actual occurrence time in
milliseconds and a stable unique completion identifier. Preserve existing identities.
Keep synthetic backdated fixture data isolated in a test project and tag it with a run ID.
Provide a dry run before the explicit ten-event send. Never commit the project key.
Include all config, source, tests and lockfile for the standalone example.
Build a daily Return On retention chart with rolling 24-hour windows. Filter both
start and return events to the same run ID and report_builder. Start: first_use.
Return: repeat_use. Verify four starters, Day 1 50%, Day 2 25%, Day 7 25%.
Check Return On or After Day 1 gives 75%; other-feature activity must be excluded.
Run the payload and failure tests. Verify processed results, not only successful flush.
Explain the simulated dataset and report changed files, test results and open checks.
```

## What this unlocks

[Product analytics](https://amplitude.com/amplitude-analytics) can measure whether people repeat `report_builder` after first use, using the completion event and its feature filter.

The same event design gives you a repeatable check when the feature changes. Keep the completion definition stable so a renamed event or changed first-use rule doesn't silently change the cohort.

## FAQ

### Should I use any activity as the return event?

Choose the completed action for the feature you're measuring. This tutorial uses `Build Retention Report Created` filtered to `report_builder` so another feature's activity doesn't count as a return.

### Why does Bob count once when he creates two reports?

Retention counts returning users for the interval. Bob's two Day 1 completions represent one returning person in a four-person entry cohort.

### Is 50% the retention rate for my product?

The 50% value comes from this controlled four-user fixture. Measure your real users' completed actions over an appropriate time range before interpreting product results.

### Can I verify Day 7 without waiting a week?

The fixture sends clearly labeled synthetic history to your test project. Its first-use events are ten days old, and one user has a return seven days later. Real customer retention requires elapsed observation time.

## Next steps

[Web frameworksNode.js product analyticsMerge event tracking into your backend's real actions.](https://amplitude.com/build/nodejs-product-analytics)[Use caseNode.js CLI telemetryBuild a command-line opt-out flow.](https://amplitude.com/build/nodejs-cli-telemetry)[ReferenceRetention calculationsCheck exact-day and on-or-after definitions before interpreting a curve.](https://amplitude.com/docs/analytics/charts/retention-analysis/retention-analysis-calculation)

Reference docs

[Node.js SDK →](https://amplitude.com/docs/sdks/analytics/node/node-js-sdk)[Build a retention analysis →](https://amplitude.com/docs/analytics/charts/retention-analysis/retention-analysis-build)[Retention calculations →](https://amplitude.com/docs/analytics/charts/retention-analysis/retention-analysis-calculation)[Time in retention analysis →](https://amplitude.com/docs/analytics/charts/retention-analysis/retention-analysis-time)[HTTP V2 event fields →](https://amplitude.com/docs/apis/analytics/http-v2)[Debug analytics →](https://amplitude.com/docs/analytics/debug-analytics)

For agents

[View raw .md](/build/nodejs-feature-retention.md)[llms.txt](/llms.txt)

## Ship the instrumentation, then read the data

Connect completed feature actions to a retention chart you can check against known results, then use real usage to measure who returns.

[Create a free account](https://app.amplitude.com/signup)[Browse all Build tutorials](https://amplitude.com/build)
