
- Recurring subscriptions
- One-time payments
- Free trials
- Refunds (for voiding partner commissions)
- Disputes (for holding partner commissions until the dispute closes)
- Cancellations/churn
- Usage expansion
Installing the Dub Stripe integration
1
Find Dub on the Stripe App Marketplace
Navigate to the Dub Stripe Integration on the Stripe App Marketplace.

2
Install the Stripe app
On the top right, click on Install app to install the Dub app on your Stripe account.
Once the app is installed, click on Continue to app settings to finish the installation.


3
Connect Stripe to your Dub workspace
In the app settings page, click on Connect workspace to connect your Stripe account with your Dub workspace.
This will redirect you to the Dub OAuth flow, where you can select the Dub workspace you want to connect to your Stripe account.
Once you click on Authorize, you will be redirected back to the Dub app settings page on Stripe, where you should see that the integration is now installed.



customer.created: When a new customer is createdcustomer.updated: When a customer is updatedcheckout.session.completed: When a customer completes a checkout sessioninvoice.paid: When an invoice is paid (for tracking recurring subscriptions)charge.refunded: When a charge is refunded (for voiding partner commissions)charge.dispute.created: When a charge is disputed (for holding partner commissions)charge.dispute.closed: When a dispute is closed (for refunding or releasing the held commission)
Tracking sales with the Dub Stripe integration
Depending on your setup, there are a few ways you can track sales with the Dub Stripe integration.- Option 1: Using Stripe Checkout (recommended)
- Option 2: Using Stripe Customers
- Option 3: Using Stripe Coupons and Promotion Codes
- Option 4: Using Stripe Payment Links
Option 1: Using Stripe Checkout (recommended)
If you have a custom checkout flow that uses Stripe’scheckout.sessions.create API, you’d want to associate the Stripe customer object with the user’s unique ID in your database (which we tracked in the lead conversion tracking step).
This will allow Dub to automatically listen for purchase events from Stripe and associate them with the original click event (and by extension, the link that the user came from).
How does this work?
How does this work?
Remember in the lead conversion tracking guide, we passed the user’s unique user ID along with the click event ID in the Under the hood, Dub records the user as a customer and associates them with the click event that they came from.Then, when the user makes a purchase, Dub will automatically associate the checkout session details (invoice amount, currency, etc.) with the customer – and by extension, the original click event.
dub.track.lead call?Node.js
dubCustomerExternalId value in the metadata field.
Node.js
Option 2: Using Stripe Customers
Alternatively, if you don’t use Stripe’s checkout session creation flow, you can also pass the user ID and the click event ID (dub_id) in the Stripe customer creation flow.
First, you’ll need to complete the following prerequisites:
- Install the Dub Stripe integration
- Enable conversion tracking for your links
- Install the Dub Analytics script
dubCustomerExternalId value in the metadata field.
Node.js
dubCustomerExternalId and dubClickId values in the metadata field of the Stripe customer update flow:
Node.js
When using Stripe Customers, lead and sale events are tracked but lead
rewards will not be
generated. Sale
rewards (both
recurring and one-time rewards) will still be generated as usual.
Option 3: Using Stripe Coupons and Promotion Codes
If you’re using Stripe Coupons and Promotion Codes, you can start tracking sale conversions simply by installing the Stripe integration in your Dub workspace. Then, follow these steps to generate discount codes for your partners on Dub, and you are all set!
While Stripe promo-code-based discounts is much easier to set up (no code
required), you sacrifice attribution accuracy since you won’t have any
insights into the customer’s geolocation, device info, referrer details, and
UTM data. Our Stripe integration will try to derive the customer’s location
based on their Stripe billing address, but it can sometimes be inaccurate.
Option 4: Using Stripe Payment Links
When using Stripe Payment Links, lead and sale events are tracked but lead
webhooks and lead
rewards will not be
generated. Sale
rewards (both
recurring and one time rewards) will still be generated as usual.
?dub_client_reference_id=1 query parameter to your Stripe Payment Link when shortening it on Dub.
Then, when a user clicks on the shortened link, Dub will automatically append the unique click ID as the client_reference_id query parameter to the payment link.

customerExternalId with their Stripe customer ID for future reference.
Alternatively, if you have a marketing site that you’re redirecting your users to first, you can do this instead:
-
Install the Dub Analytics script, which automatically detects the
dub_idin the URL and stores it as a first-party cookie on your site. -
Then, retrieve and append the
dub_idvalue as theclient_reference_idparameter to the payment links on your pricing page / CTA button (prefixed withdub_id_).
What if I'm using Stripe Pricing Tables?
What if I'm using Stripe Pricing Tables?
If you’re using Stripe Pricing Tables – you’d want to pass the Dub click ID as a
client-reference-id attribute instead:What if I'm using Stripe's Checkout Sessions API?
What if I'm using Stripe's Checkout Sessions API?
If you’re using Stripe’s Checkout Sessions API for a recurring subscription service, you might want to check out our Stripe Checkout option instead.If your setup doesn’t involve a lead/signup event and goes straight to the Stripe checkout flow (e.g. for one-time purchases), you can simply pass the Dub click ID (prefixed with
dub_id_) as the client_reference_id parameter to enable conversion tracking with Dub.Tracking free trials
Dub supports tracking subscription free trials as lead events on Dub. This is useful for products with free trials since you might want to track trial activations as part of your attribution flow. To enable free trial tracking, go to your Stripe integration settings and enable the Track Free Trials option:
First-time order restriction
By default, discount codes created via Dub are restricted to first-time orders in Stripe. That means the code can only be redeemed by customers who have never made a purchase (Stripe treats any successful payment or paid invoice as a prior purchase). If your signup flow creates a trial subscription or a $0 invoice, Stripe may classify those customers as returning purchasers and reject the code. In that case, go to your Stripe integration settings and disable Eligible for first-time order only:
Changes will only take effect for future discount codes. Existing promotion
codes keep the restriction they were created with.
Handling disputes
When a customer disputes a charge in Stripe, Dub puts the partner commission for that sale on hold. An on-hold commission cannot be added to a payout, so the partner is not paid while the dispute is open. If the commission is already in a pending payout, Dub removes it from that payout.Holding commissions for open disputes is only available on Advanced plans and above.
A lost dispute refunds the commission on every plan, the same as a Stripe refund.
A won dispute keeps the commission on hold in these cases:
- The commission was already on hold before the dispute opened (for example, a manual hold).
- A pending risk event also covers the commission.
Dub does not change a commission after its payout starts processing or is paid. To recover a paid commission after a lost dispute, create a clawback.
Tax handling
When tracking sale conversions from Stripe, Dub automatically excludes taxes from the final sale amount to ensure accurate revenue reporting. For checkout sessions, Dub calculates the sale amount by subtracting the tax amount from the total:total_excluding_tax. A partly paid invoice (for example, when a credit balance is applied) records the paid amount without its tax share.
This ensures that the sale amounts recorded in Dub reflect the actual revenue before taxes, providing more accurate metrics for:
- Revenue tracking and reporting
- Partner commission calculations
- Analytics and conversion metrics
Tax amounts are automatically excluded from all sale events tracked through
the Stripe integration, including one-time purchases, subscriptions, and
recurring invoices.
Currency conversion support
If you’re using Stripe’s Adaptive Pricing feature, Dub will record the sale amount using the currency of your Stripe account:checkout.session.completed
currency_conversion.amount_total includes tax, so Dub removes the session’s tax share first: currency_conversion.amount_total × (amount_total − total_details.amount_tax) / amount_total.
If you’re not using Stripe Adaptive Pricing, Dub will record the sale amount in the default currency of your Dub workspace. This means that if you pass a different currency, it will be automatically converted to USD for reporting consistency – using the latest foreign exchange rates.
checkout.session.completed
The default currency for all Dub workspaces is currently set to
USD. We will
add the ability to customize that in the future.Multiple line items per invoice
When a Stripe invoice or checkout session contains multiple line items (e.g. a base subscription plus an add-on, or several products purchased in a single transaction), Dub processes each line item individually to calculate the correct commission amount. For each line item, Dub:- Resolves the Stripe product ID for that line item.
- Matches it against any product-specific reward modifiers configured for the partner’s group.
- Calculates the commission for that line item using the matching reward rate (falling back to the default reward if no modifier matches). The commission uses that line’s share of the recorded sale amount (after discounts, tax exclusion and currency conversion), not the raw Stripe line amount. Line items without a product keep their share of the sale but earn no product commission.
saleAmount recorded on Dub still reflects the full invoice total (after tax exclusion and currency conversion), so your revenue analytics remain accurate.
View conversion results
And that’s it – you’re all set! You can now sit back, relax, and watch your conversion revenue grow. We provide 3 different views to help you understand your conversions:- Time-series: A time-series view of the number clicks, leads and sales.

- Funnel chart: A funnel chart view visualizing the conversion & dropoff rates across the different steps in the conversion funnel (clicks → leads → sales).

- Real-time events stream: A real-time events stream of every single conversion event that occurs across all your links in your workspace.

Example apps
Dub + Stripe Demo App
See the full example on GitHub.
