Log Stripe subscription cancellations to Amplitude and a churn sheet

The moment a Stripe subscription cancels, record a churn event in Amplitude and add a row to your finance and CS churn tracker sheet.

Deterministic Code
StripeAmplitudeGoogle SheetsProductFinanceData SyncNotifications & Alerts
PromptCreate

Whenever a Stripe subscription is canceled, I want to ingest a matching churn event into Amplitude and log the cancel to a churn tracker Google Sheet. Every step is deterministic and no LLM reasoning is needed.

Trigger: a Stripe webhook on the customer.subscription.deleted event. When Stripe fires the webhook, read the payload and pull the subscription's customer email, plan name (or price nickname), MRR (in the smallest currency unit converted to a number), the subscription start date, and the cancellation reason from cancellation_details.reason (falling back to canceled_at or an empty string when it is missing). Also capture the Stripe event id and the canceled_at timestamp.

Step 1: call Amplitude's Send Events (HTTP V2) operation to record a single event. Use the customer email as user_id, event_type set to a configurable event name that defaults to "Subscription Canceled", the canceled_at time as the event time, and event_properties containing plan, mrr, start_date, cancellation_reason, and stripe_subscription_id. Use the Stripe event id as insert_id so retries dedupe safely on Amplitude's (device_id, event_type, time, insert_id) key.

Step 2: call Amplitude's Identify (Update User Properties) operation for the same user_id, setting is_churned=true, churned_at=canceled_at (ISO 8601), churn_mrr=MRR, and last_plan=plan. This is a user-property update only, not a second event.

Step 3: call Google Sheets Append Values on a configurable Sheet ID and tab (default "Churn Log"), appending one row in this column order: customer email, plan, MRR, tenure in days (canceled_at minus start_date, rounded down), cancellation reason, and ISO 8601 timestamp. Use valueInputOption USER_ENTERED so the timestamp and numbers are parsed correctly.

Expose two knobs on the prompt page: the Amplitude event name (default "Subscription Canceled") and the Google Sheet spreadsheet ID plus tab name. Respect Amplitude data residency when configured. If the webhook payload lacks an email, skip the row and the event rather than sending a blank user_id.

What does this prompt do?

  • Listens for subscription cancellations in Stripe and captures each one the moment it happens.
  • Records a Subscription Canceled event in Amplitude so churn shows up on your funnels and retention charts alongside product usage.
  • Marks the customer's Amplitude profile as churned with the timestamp, lost MRR, and last plan so cohorts pick them up automatically.
  • Appends a row to your Churn Log Google Sheet with the customer, plan, MRR, tenure in days, cancellation reason, and timestamp for finance and CS.

What do I need to use this?

  • A Stripe account with permission to configure webhooks
  • An Amplitude project on the US or EU data center
  • A Google account with edit access to the Churn Log spreadsheet

How can I customize it?

  • Choose the Google Sheet and tab where cancellations get logged
  • Rename the Amplitude event and user property names to match your team's taxonomy
  • Filter to specific plans or price IDs if you only want to log certain subscription tiers

FAQs

Why bother sending Stripe cancellations into Amplitude when Amplitude already tracks usage?
Most Amplitude setups only see events fired from the product itself. Subscription cancellations happen on Stripe's side, often through billing pages or dunning retries, so they never make it into Amplitude on their own. Bridging them in means your retention and churn charts finally match the money.
What happens if Stripe retries the webhook or fires it twice?
The workflow uses the Stripe event id as the deduplication key when sending to Amplitude, so retries do not create duplicate churn events. The Google Sheet row is written once per cancellation on the first successful delivery.
Does this capture cancellations from Stripe's dunning flow too?
Yes. Stripe emits a subscription cancellation event whether the customer clicks Cancel, an admin cancels on their behalf, or the subscription is closed after failed payment retries. All three land in the same tracker.
Will this work if my Amplitude project is on the EU data center?
Yes. When you connect Amplitude, set the data residency to EU and the workflow will send events and profile updates to the EU endpoints instead of the US ones.
Can I change what columns get written to the churn sheet?
Yes. The default row includes customer email, plan, MRR, tenure in days, cancellation reason, and timestamp, but you can add or reorder columns after the workflow is set up.

Related templates

Weekly Amazon S3 bucket security audit posted to Slack

Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.

Amazon S3
Slack Bot
Google Sheets
Agentic Task
Turn procurement portal tenders into CRM deals each morning

Every weekday at 7am, sign in to the tender portals you track, filter new notices against your bid criteria, and open a deal for the ones worth chasing.

Anchor Browser
Google Sheets
HubSpot
+1
Agentic Task
Draft polite follow-ups for emails that never got a reply

Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.

Aurinko
Google Sheets
Slack Bot
Agentic Task
Flag VIP client emails in Zoho Mail and alert your team

Keep a spreadsheet of your most important senders, and every email from one gets labeled, posted to your team channel, and logged automatically.

Zoho Mail
Google Sheets
Slack Bot
Deterministic Code
Send Yotpo review requests when Shopify orders ship

The moment an order is fulfilled, we register it with Yotpo so the review request is timed off real delivery, and we log every sync so failures never go unnoticed.

Shopify
Yotpo
Google Sheets
Deterministic Code
Reconcile Shopify sales against Zoho Books every night

Every night at 11pm we compare the day's Shopify orders with your Zoho Books invoices and payments, and flag only what does not match.

Zoho Books
Shopify
Google Sheets
+1
Agentic Task

Stop guessing why your Amplitude churn charts look wrong.

Bridge Stripe's server-side cancellations into your product analytics and finance log so every team sees the same story.