On this page

Stripe

This integration imports revenue events from Stripe into Amplitude, so you can track and analyze your Stripe financial data in Amplitude.

Beta

This feature is in Beta. This feature may continue to evolve. This documentation may not yet reflect the latest updates.

Amplitude maintains this integration. For help, contact Amplitude support.

Prerequisites

  • If you have multiple Amplitude projects, configure this integration separately for each one to ensure accurate event tracking.
  • Amplitude can't distinguish between Stripe events from different accounts, because Stripe event payloads don't include an account identifier. If you connect multiple Stripe accounts to the same Amplitude project, you may experience data duplication and inaccurate revenue reporting.
  • This integration only records events that occur after you configure the Stripe webhook. It doesn't retroactively capture or send to Amplitude anything that happened before that, so configure it as early as possible.
  • Before sending revenue data to Amplitude, normalize all financial amounts to your preferred currency. Amplitude doesn't automatically handle currency conversion, and inconsistent currency reporting could distort revenue insights.
  • This integration only ingests revenue-related transaction events.
  • To avoid tracking inaccuracies, set amplitude_id or user_id correctly in the metadata. Otherwise, events from the same user may appear as separate users in Amplitude. Update your Stripe client to pass the correct user identifier within the metadata fields for proper event deduplication.

Set up the integration

  1. Log into your Stripe account and navigate to Developers > Event Destination.
  2. Click Add Endpoint to create a webhook.
  3. Paste the provided URL into the Endpoint URL field to direct data to your Amplitude project.
  4. Select API version 2024-06-20 and choose the events you want to ingest into Amplitude.
  5. Click Select Events to specify the topics you want to forward to Amplitude. Note that Amplitude categorizes payment_intent as revenue events.
  6. Set the correct user ID in your Stripe client code to ensure proper deduplication of user events between Stripe and Amplitude. The integration looks for the user ID in a specific order of priority from the event payload. Make sure the user ID is correctly passed as metadata in the payment intent or other relevant events.

Here is the order in which Amplitude picks up the user ID from Stripe event data:

  • data.object.metadata.amplitude_id
  • data.object.metadata.user_id
  • data.object.customer_email
  • data.object.customer.email
  • data.object.receipt_email
  • data.object.customer

View Stripe events in Amplitude: Example charts and cohorts

Here are some key charts and metrics you can track after you set up the integration.

Total revenue

  1. Select an event: Choose the event that tracks successful payments or transactions, such as [Stripe] invoice.payment_succeeded.
  2. Set a metric: Use Property Sum to calculate the total revenue. Set the property to amount_paid or another property that stores the revenue amount. This sums the total revenue from all successful payment events.
  3. Apply segmentation: Choose All Users for an overview of total revenue generated by all users who triggered the event from step 1 above.

Average number of purchases per user

  1. Select an event: Choose an event that represents a successful transaction or purchase, such as self-serve: stripe payment intent success , Purchase Completed , or Order Success.
  2. Set a metric: Measure the average number of events per user to track how often users trigger the event.
  3. Apply segmentation: Choose All Users for an overview of all user activity related to that event.

Distribution of purchase frequency

  1. Select an event: Choose an event that tracks successful payments or purchases, such as [Stripe] invoice.payment_succeeded.
  2. Set a metric: Choose Frequency to measure how many times users have triggered the selected event.
  3. Set buckets: Define the buckets to categorize purchase frequency. This helps visualize how many users fall into each frequency category.
  4. Apply segmentation: Choose All Users for an overview of how often users make purchases.

N-week retention

  1. Select a starting event: Choose the event that represents a successful transaction or purchase, such as [Stripe] invoice.payment_succeeded.
  2. Select a return event: Choose the same event, or a similar one, to track users who come back to make another purchase.
  3. Set the retention metric: Select Return On to measure retention based on when users return to trigger the same event in specific time windows (for example, weeks). The chart displays retention across multiple weeks (Week 0, Week 1, etc.), showing how many users return after making a purchase in subsequent weeks.
  4. Apply segmentation: Choose All Users for an overview of all users who made a purchase and returned.

Revenue by product

  1. Select an event: Choose the event that represents a successful transaction or payment, such as [Stripe] invoice.payment_succeeded.
  2. Set a metric: Use Property Sum to calculate the total revenue. Group by the product category or name using the description field (or a similar field) that stores product details. This sums up the total revenue for each product.
  3. Group by product: Group the results by product name or category to visualize revenue per product.
  4. Apply segmentation: Choose All Users for a breakdown of revenue for all products sold.

Number of orders by product

  1. Select an event: Choose the event that represents successful transactions or orders, such as [Stripe] invoice.payment_succeeded.
  2. Set a metric: Use Uniques to count the unique occurrences of the event.
  3. Group by product: Group the data by the product name or description using the Description field (or a similar product-related field). This breaks down the number of orders per product.
  4. Apply segmentation: Choose All Users for a complete overview of the number of orders for each product made by all users.

Cohort: Users who spent more than $100 in their first seven days

  1. Select users who performed an event: Choose the event that captures successful transactions, such as [Stripe] payment_intent.succeeded.
  2. Set a revenue condition: Apply a condition where $revenue > 100 to filter for users who spent more than $100, either in a single transaction or over multiple transactions.
  3. Set a count condition: Add a condition to ensure the event occurred at least once.
  4. Define the timeframe: Specify that the transactions must have occurred during the first seven days after the user's first interaction, or within the last 30 days for more flexible tracking.

Supported Stripe events in Amplitude

This table lists revenue-related events sent from Stripe to Amplitude. These events let you track financial transactions such as charges, refunds, invoices, and payments. For more detailed information on the properties associated with each event, refer to the official Stripe events documentation.

Was this helpful?