Learn how to track a sale conversion event with Stripe
sale
event happens when a user purchases your product or service. Examples include:
Find Dub on the Stripe App Marketplace
Install the Stripe app
Connect Stripe to your Dub workspace
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 tracking refunds and updating payout commissions for Dub Partners)?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.
externalId
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:
dub_id
in the URL and stores it as a first-party cookie on your site.
dub_id
value as the client_reference_id
parameter to the payment links on your pricing page / CTA button (prefixed with dub_id_
).
What if I'm using Stripe Pricing Tables?
client-reference-id
attribute instead:What if I'm using Stripe's Checkout Sessions API?
dub_id_
) as the client_reference_id
parameter to enable conversion tracking with Dub.checkout.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?
dub.track.lead
call?dubCustomerId
value in the metadata
field.
dub_id
) in the Stripe customer creation flow.
First, you’ll need to complete the following prerequisites:
dubCustomerId
value in the metadata
field.
dubCustomerId
and dubClickId
values in the metadata
field of the Stripe customer update flow: