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:

  1. Enable conversion tracking for your links
  2. Install the @dub/analytics client-side SDK
  3. Install the Dub server-side SDK

Then, depending on your authentication provider, follow the relevant guide to set up lead conversion tracking:

Step 1: Configure sale tracking

Next, depending on which payment processor you’re using, you can leverage our native integrations to track sale events:

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:

PropertyRequiredDescription
externalIdYesThe unique ID of the customer in your system. Will be used to identify and attribute all future events to this customer.
amountYesThe amount of the sale in cents.
paymentProcessorYesThe payment processor that processed the sale. (E.g. Stripe, Shopify)
eventNameNoThe name of the event. Defaults to “Purchase”.
invoiceIdNoThe unique ID of the invoice in your system.
currencyNoThe currency of the sale. Defaults to “usd”.
metadataNoAn 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:

  • 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.