Track a lead
track_leadRecord a lead conversion for a short link, attributed to a click ID and customer, to support later sale attribution in Dub.
Instructions
Track a lead for a short link.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | The mode to use for tracking the lead event. `async` will not block the request; `wait` will block the request until the lead event is fully recorded in Dub; `deferred` will defer the lead event creation to a subsequent request. | async |
| account | No | Exact configured private workspace profile label; not a tenant or provider account ID. | |
| clickId | No | The unique ID of the click that the lead conversion event is attributed to. You can read this value from `dub_id` cookie. [For deferred lead tracking]: If an empty string is provided, Dub will try to find an existing customer with the provided `customerExternalId` and use the `clickId` from the customer if found. | |
| confirm | No | Must be true for the requested mutation or exclusive private output file. | |
| payload | No | Complete native JSON body; do not mix with body flags or payload_file. Arrays use repeated JSON object flags or a whole native array in a private file. | |
| metadata | No | Additional metadata to be stored with the lead event. Max 10,000 characters. | |
| eventName | No | The name of the lead event to track. Can also be used as a unique identifier to associate a given lead event for a customer for a subsequent sale event (via the `leadEventName` prop in `/track/sale`). | |
| customerName | No | The name of the customer. If not passed, a random name will be generated (e.g. “Big Red Caribou”). | |
| payload_file | No | Absolute regular non-symlink JSON body file, at most 1 MiB. Cannot mix with payload/body flags. | |
| customerEmail | No | The email address of the customer. | |
| eventQuantity | No | The numerical value associated with this lead event (e.g., number of provisioned seats in a free trial). If defined as N, the lead event will be tracked N times. | |
| customerAvatar | No | The avatar URL of the customer. | |
| customerExternalId | No | The unique ID of the customer in your system. Will be used to identify and attribute all future events to this customer. |