Learn how to track lead conversion events with Clerk and Dub
lead
event happens when a user performs an action that indicates interest in your product or service. This could be anything from:
Add environment variables
Add a custom claim to your Clerk session token
Extend the `@dub/analytics` package with Clerk's `useUser` hook
@dub/analytics
package to include a trackLead
server action.DubAnalytics
component to your app’s root layout component:Implement the `trackLead` server action
trackLead
server action. Alternatively, you can also create an API route 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”. |
customerExternalId | 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. |