Learn how to get started with Dub Conversions
@dub/analytics
client-side SDKC
keyboard shortcut when inside the link builder to
quickly enable conversion tracking for a given link.trackConversion: true
when creating or updating a link:
@dub/analytics
client-side SDKdub_id
query parameter and storing it as a first-party cookie, which will be used to attribute subsequent conversion events to the original link.
lead
event. This happens when a user performs an action that indicates interest in your product or service. This could be anything from:
Sign Up
, which happens when a user signs up for an account. Depending on which authentication framework you’re using, here are a few examples of how to send Sign Up
lead events:
dub_id
cookie. In that case, try using a library like cookie
instead:Property | Required | Description |
---|---|---|
clickId | Yes | The unique dub_id parameter that the lead conversion event is attributed to. |
eventName | Yes | The name of the event. Example: “Sign up”. |
externalId | Yes | The unique ID of the customer in your system. Will be used to identify and attribute all future events to this customer. |
customerEmail | No | The email address of the customer. If not passed, a random email address will be generated. |
customerName | No | The name of the customer. If not passed, a random name will be generated (e.g. “Big Red Caribou”). |
customerAvatar | No | The avatar URL of the customer. If not passed, a random avatar URL will be generated. |
sale
event. This happens when a user purchases your product or service. This could be anything from:
POST /track/sale
API endpoint.
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 invoice ID of the sale. Can be used as a idempotency key – only one sale event can be recorded for a given invoice ID. |
currency | No | The currency of the sale. Defaults to “usd”. |
metadata | No | An object containing additional information about the sale. |