How does conversion tracking work on Dub?
The way conversion tracking on Dub works can be boiled down to 3 simple steps:1
Click Event
This is the first step in the conversion funnel. It can either be:
- A link click on a social media post/ad
- A link click in an email/SMS
- A QR code scan for physical (or video) campaigns
2
Lead Event
When a user performs an action that indicates interest in your product or
service. This could be anything from:
- Signing up for an account
- Adding a product to cart
- Joining a mailing list
3
Sale Event
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
How are conversions tracked?
Dub uses a simple first-party cookie and server-side event tracking to track conversions.Step 1: Storing click ID as a first-party cookie
When a user clicks on a conversion-enabled link, Dub generates a uniquedub_id query parameter and stores it as a first-party cookie on your domain (e.g. .dub.co).

dub_id query parameter and storing it as a first-party cookie.
Step 2: Attributing conversion events to the original click
Then, when a conversion event occurs (e.g. a user signs up for an account), you can check for thedub_id cookie and attribute the conversion to the original click.

The lead event will serve as the source of truth for the customer’s identity and which link they came from. This means that all subsequent actions performed by the customer (e.g. upgrading their plan, purchasing a product) will automatically be attributed to the original link.
Step 3: Sending sale events
The final step in the conversion funnel is to track sale events and attribute them to the original link click. This can be done in 3 ways:
- Install our Stripe integration in your Dub workspace. For security reasons, the integration will have read-only access to your Stripe account.
- When a user creates a checkout session on your app, pass the user’s unique ID in your system as the
dubCustomerIdproperty in themetadatafield. - This way, when the user completes their checkout session, Dub will receive a webhook from Stripe containing the
dubCustomerId. - If the
dubCustomerIdmatches a customer that came from a conversion-enabled link, Dub will track the sale as a result of that link.
- Install the Dub Shopify app in your Shopify store.
- When a sale is made, the integration will automatically detect and track a laed + sale event in Dub.
POST /track/sale endpoint that you can use to send sale events to Dub. Here’s an example using the Dub TypeScript SDK:
/api/billing/upgrade
How do I see the conversions?
All your tracked conversions will show up on your Analytics dashboard. 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.

What can I build with Dub?
There are various use cases for Dub. Here are a few examples:1. White-labeled affiliate/referral programs
With Dub Partners (built on top of Dub), you can track how well your affiliate/referral links are performing and display the real-time analytics directly inside your application. For instance, here’s a screenshot of our very own Dub referral program – powered by Dub – that lives within the Dub dashboard: