POST
/
track
/
lead
JavaScript
import Codeqr from '@codeqr/ts';

const client = new Codeqr({
  apiKey: 'My API Key',
});

const response = await client.track.trackLead({ clickId: 'x', customerId: 'x', eventName: 'Sign up' });

console.log(response.click);
{
  "click": {
    "id": "<string>"
  },
  "customer": {
    "id": "<string>",
    "name": "<string>",
    "email": "<string>",
    "avatar": "<string>"
  }
}
Conversions endpoints require a Business plan subscription or higher.

Authorizations

Authorization
string
header
required

Default authentication mechanism

Body

application/json
clickId
string
required

The ID of the click in th CodeQR. You can read this value from cq_id cookie.

Minimum length: 1
eventName
string
required

The name of the event to track.

Required string length: 1 - 50
Example:

"Sign up"

customerId
string
required

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

Required string length: 1 - 100
customerName
string | null

Name of the customer in the client's app.

Maximum length: 100
customerEmail
string<email> | 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.

Maximum length: 100
metadata
object | null

Additional metadata to be stored with the lead event

Response

A lead was tracked.

click
object
required
customer
object
required