'identify' Method
Custom Intempt Method for User Identification
Purpose
The identify method is used to:
- Assign a unique identifier (usually a user ID) to each user.
- Link all subsequent actions and events to this user ID.
- Link all subsequent actions and events to this user ID.
Usage example
The following JavaScript example illustrates how to use the identify within a login request scenario. This function is crucial for identifying and tracking user activities and behaviors in applications:
function loginRequest(user) {
return authUser(user)
.then(authorizedUser => {
intempt.identify({
userId: user.email
})
})
}
This usage scenario involves calling the identify function after successfully authenticating the user, ensuring that all subsequent actions are correctly associated with the identified user.
Declaration
The identify method is declared as follows in TypeScript, indicating that it does not return any value:
identify(params:IdentifyParams):void
Params
The parameters for the identify method are defined by the IdentifyParams
type, which allows for detailed user tracking and event categorization:
type IdentifyParams = {
userId: string,
eventTitle?: string,
userAttributes?:{[key:string]:any}
data?:{[key:string]:any}
}
Forbidden event names for use
Certain event names are reserved or forbidden to prevent conflicts or misidentification in the tracking system. They include common actions and default functionalities that are automatically tracked or handled differently:
- auto-track: Reserved for automatic tracking mechanisms.
- view page: Used specifically for page view tracking.
- leave page: Indicates a user leaving a page, automatically tracked.
- change on: Indicates a user leaving a page, automatically tracked.
- click on: Indicates a user leaving a page, automatically tracked.
- submit on: Used for tracking form submissions.
- identify: Special use within the identify function itself.
- consent: Special use within the identify function itself.
These names should not be used as custom event titles to avoid system errors and ensure accurate event categorization and analysis.
Updated about 3 hours ago