POST
/
track
/
lead
from dub import Dub


with Dub(
    token="DUB_API_KEY",
) as d_client:

    res = d_client.track.lead(request={
        "click_id": "<id>",
        "event_name": "Sign up",
    })

    assert res is not None

    # Handle response
    print(res)
{
  "click": {
    "id": "<string>"
  },
  "customer": {
    "name": "<string>",
    "email": "<string>",
    "avatar": "<string>",
    "externalId": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Body

application/json
clickId
string
required

The ID of the click in Dub. You can read this value from dub_id cookie.

Minimum length: 1
eventName
string
required

The name of the lead event to track.

Required string length: 1 - 255
Example:

"Sign up"

eventQuantity
number | null

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.

externalId
string
default:

This is the unique identifier for the customer in the client's app. This is used to track the customer's journey.

Maximum length: 100
customerId
string | null
deprecated

This is the unique identifier for the customer in the client's app. This is used to track the customer's journey.

Maximum length: 100
customerName
string | null

Name of the customer in the client's app.

Maximum length: 100
customerEmail
string | null

Email of the customer in the client's app.

Maximum length: 100
customerAvatar
string | null

Avatar of the customer in the client's app.

metadata
object | null

Additional metadata to be stored with the lead event

mode
enum<string>
default:async

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.

Available options:
async,
wait

Response

200
application/json
A lead was tracked.
click
object
required
customer
object
required