Lead generated
Learn how to track when a user becomes a lead.
This event tracks when a user becomes a lead.
Track this event whenever a user submits a form or does any action that represents they become a lead.
Implementation
Here is an example of how to track this event:
import croct from '@croct/plug';
croct.track('leadGenerated', { userId: '1ed2fd65-a027-4f3a-a35f-c6dd97537392'});Input properties
These are the supported properties:
- leadId(optional)string
The lead's unique identifier provided by the application, such as a UUID.
The value must be between 1 and 100 characters long.
- currency(optional)string
The currency in which the lead monetary value is expressed, such as "USD" or "EUR".
We recommend using the 3-letter currency codes defined by the ISO 4217 standard. For currencies having no official recognition in the standard, consider using ISO-like codes adopted locally or commercially, such as "XBT" for BitCoin.
- value(optional)number
The monetary value associated with the lead.
The value must be non-negative.
- lead(optional)object
The lead profile.
- firstName(optional)
The first name of the user. For example, "John".
The value must be between 1 and 50 characters long.
- lastName(optional)
The last name of the user. For example, "Doe".
The value must be between 1 and 50 characters long.
- birthDate(optional)
The birth date of the user. For example, 1990-01-01.
The value must be a valid date in the format YYYY-MM-DD.
- gender(optional)
The gender of the user.
These are the possible values and what they represent:
Value Description male Male gender. female Female gender. neutral Neither male nor female gender. unknown An unspecified gender. - email(optional)
The email address of the user. For example, "john@example.com".
The value must be between 1 and 254 characters long.
- alternateEmail(optional)
The alternate email address of the user, such as a work email address or a secondary email address.
The value must be between 1 and 254 characters long.
- phone(optional)
The phone number of the user. For example, "+1 555 555 5555".
The value must be between 1 and 30 characters long.
- alternatePhone(optional)
The alternate phone number of the user, such as a work phone number or a secondary phone number.
The value must be between 1 and 30 characters long.
- address(optional)object
The address of the user.
- street(optional)
The street part of the user's address, like "123 Elm Street".
The value must be between 1 and 100 characters long.
- district(optional)
The district or area of the user's address.
The value must be between 1 and 100 characters long.
- city(optional)
The city of the user's address.
The value must be between 1 and 100 characters long.
- region(optional)
The region, state, or province of the user's address.
The value must be between 1 and 100 characters long.
- country(optional)
The country of the user's address.
The value must be between 1 and 100 characters long.
- postalCode(optional)
The postal or ZIP code of the user's address.
The value must be between 1 and 20 characters long.
- avatar(optional)
The URL of the user's avatar image.
The value must be a well-formed URL.
- company(optional)
The company the user works for.
The value must be between 1 and 200 characters long.
- companyUrl(optional)
The URL of the company the user works for.
The value must be a well-formed URL.
- jobTitle(optional)
The job title of the user.
The value must be between 1 and 50 characters long.
- custom(optional)object
A map of custom attributes associated with the user.
The following restrictions apply to custom attributes:
- Profiles support up to 10 custom attributes
- Attribute names must be strings up to 20 characters, starting with a letter or underscore, followed by letters, digits, or underscores
- Attributes can be primitives (strings, numbers, booleans, null) or collections (lists, maps)
- Strings can be up to 100 characters long
- Lists can contain up to 30 elements, including primitives, lists of primitives, or maps of primitives
- Maps can contain up to 30 elements, including primitives, lists of primitives, or maps of primitives
- Map keys must be strings up to 50 characters long
Processed properties
These properties are automatically tracked:
- leadId(optional)string
The lead's unique identifier.
- currency(optional)string
The currency in which the lead monetary value is expressed, such as "USD" or "EUR".
- value(optional)number
The monetary value associated with the lead.
- patch(optional)object
A series of operations derived from the lead input property.
The patch created from the input lead is used internally to reflect changes in the user profile.
Payload examples
Below are some payload examples for this event:
{ "leadId": "1ed2fd65-a027-4f3a-a35f-c6dd97537392" "currency": "USD", "value": 100, "lead": { "firstName": "Carol", "lastName": "Doe", "birthDate": "2000-08-31", "gender": "female", "email": "carol@croct.com", "alternateEmail": "example@croct.com", "phone": "+15555983800", "alternatePhone": "+15555983800", "address": { "street": "123 Some Street", "district": "Kings Oak", "city": "San Francisco", "state": "California", "region": "California", "country": "US", "continent": "NA" }, "avatar": "http: //croct.com/carol.png", "company": "Croct", "companyUrl": "http: //croct.com", "jobTitle": "Head of Marketing", "custom": { "points": 1, "favoriteEmoji": "🐊" } }}