Push every Stripe charge into Mixpanel in real time

By General Input

When Stripe confirms a successful charge, send the revenue event to Mixpanel, bump the customer's lifetime value, and stamp their latest plan so analytics is always current.

Integrations

  • Stripe
  • Mixpanel

Type

Deterministic Code

Categories

  • Product
  • Operations

I want a Stripe-to-Mixpanel revenue pipe that runs every time a Stripe charge succeeds, so product analytics has clean revenue data without waiting for a nightly export. Build it as a code-based workflow with three deterministic steps.

Trigger: a Stripe webhook listening for the charge.succeeded event.

Step 1: call the Mixpanel Track Event operation to record an event named "Charge Succeeded". Use the Stripe customer ID as the distinct_id when present, otherwise fall back to the customer email. Event properties should include amount (converted from Stripe's smallest currency unit into a decimal, for example 2500 cents becomes 25.00), currency, plan (pulled from invoice or subscription metadata when available), and the Stripe charge ID. Pass the Stripe charge ID as Mixpanel's $insert_id so any webhook retries are idempotent and Mixpanel deduplicates them.

Step 2: call the Mixpanel Increment Profile Numerical Property operation on the same distinct_id to add the charge amount (decimal, same conversion as step 1) to a profile property called lifetime_value.

Step 3: call the Mixpanel Set Profile Properties operation on the same distinct_id, setting last_charged_at to the charge timestamp (ISO 8601), last_charge_amount to the decimal charge amount, and plan to the current plan name.

Every step is a fixed transformation with no branching or LLM judgment, so this should be a code workflow: Stripe webhook trigger followed by three Mixpanel nodes in sequence. If Stripe ever sends a charge.succeeded event for a charge whose customer cannot be resolved to either a customer ID or an email, log a warning and stop the run rather than sending events with no distinct_id.

Related prompts

Explore more prompts
Let support send one-off Loops emails without an engineerCustomer lifecycle inspector for Loops, Stripe and PostHogMonth-end Stripe finance pack, stored and shared in SlackRank your Intercom queue by what each customer pays youCatch the trials quietly dying before the card gets chargedWork every open Stripe dispute from one chargeback war roomLook up any customer's support, billing and CRM in one pageInvestor update studio that builds your board deck monthlySell and invoice Ghost newsletter sponsor slots in one boardSupport console that pairs Gladly chats with orders and refunds