Track cancelled subscriptions in Node.js

Learn how to use Operational to track when customers cancel subscriptions in your Node.js app.

What is cancelled subscription tracking in Node.js

Tracking when users cancel their subscriptions helps you understand churn.

In a Node.js application you can send this data to an analytics tool.

For example you might want to record who cancelled and which plan they were on.

This helps you spot trends and improve retention.

Using Operational to track cancellations

Operational is an open source event tracking tool for any product.

You can use it to record cancellations in real time.

Operational in Action

Setting up Operational

  1. Go to https://app.operational.co and sign up for an account.
  2. In the dashboard navigate to the API keys section.
  3. Copy your API key from the dashboard.
  4. Install the SDK by running npm install @operational.co/sdk.

Code example in Node.js

import Operational from "@operational.co/sdk"

const ops = new Operational("API_KEY")

const payload = {
  name: "subscription cancelled",
  avatar: "",
  content: "Customer John Smith cancelled their subscription, id 123."
}

await ops.events.ingest(payload)

This code sends an event to Operational whenever a subscription is cancelled.

Conclusion

Tracking cancelled subscriptions lets you find out why users leave.

Operational makes it easy by handling event ingestion and storage.

Learn more at https://operational.co and try examples in the playground at https://operational.co/playground