Skip to main content

Identify

The Identify method lets you tie a user to their actions and record traits about them.

Usage​

err := client.Identify(ctx, userID, traits)

Parameters​

NameTypeDescription
ctxcontext.ContextContext for the request.
userIDstringUnique identifier for the user (e.g., database ID).
traitsmap[string]interface{}Dictionary of attributes associated with the user.

Traits​

Traits are pieces of information you know about a user, such as their email, name, or plan. The Conviso recognizes some special traits:

  • email
  • firstName / first_name
  • lastName / last_name
  • phone
  • avatar
  • createdAt / created_at

Example​

traits := map[string]interface{}{
"email": "[email protected]",
"firstName": "Alice",
"lastName": "Smith",
"plan": "Pro",
"created_at": "2023-01-01T12:00:00Z",
}

if err := client.Identify(context.Background(), "user_123", traits); err != nil {
log.Println("Error identifying user:", err)
}