Introduction
Learn how to track sales conversion events with Dub Conversions
When it comes to conversion tracking, a sale
event happens when a user purchases your product or service. Examples include:
- Subscribing to a paid plan
- Usage expansion (upgrading from one plan to another)
- Purchasing a product from your online store
In this guide, we will be focusing on tracking sales conversion events with Dub.
Prerequisites
Before you get started, make sure you follow the Dub Conversions quickstart guide to get Dub Conversions set up for your links:
- Enable conversion tracking for your links
- Install the @dub/analytics client-side SDK
- Install the Dub server-side SDK
Then, depending on your authentication provider, follow the relevant guide to set up lead conversion tracking:
NextAuth.js
Tracking lead events with NextAuth.js
Clerk
Tracking lead events with Clerk
Supabase
Tracking lead events with Supabase
Auth0
Tracking lead events with Auth0
Step 1: Configure sale tracking
Next, depending on which payment processor you’re using, you can leverage our native integrations to track sale events:
Stripe
Tracking sale conversion events with Stripe and the Dub SDK
Shopify
Tracking sale conversion events with Shopify and the Dub SDK
If you’re not using any of the providers listed above, you can also manually track sale events using our native SDKs within your backend code:
Here are the properties you can include when sending a sale event:
Property | Required | Description |
---|---|---|
externalId | Yes | The unique ID of the customer in your system. Will be used to identify and attribute all future events to this customer. |
amount | Yes | The amount of the sale in cents. |
paymentProcessor | Yes | The payment processor that processed the sale. (E.g. Stripe, Shopify) |
eventName | No | The name of the event. Defaults to “Purchase”. |
invoiceId | No | The unique ID of the invoice in your system. |
currency | No | The currency of the sale. Defaults to “usd”. |
metadata | No | An object containing additional information about the sale. |
Step 2: 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.
Was this page helpful?