Users
Users
EnaLog supports the ability to track events per user by easily tying events to a user from your application.
Events and Users are linked by a unique User ID, this could be your internal User ID from your database
or email address or another unique identifier such as a UUID.
Creating Users
Creating Users is EnaLog can be done when pushing events by including the user_id
key and a unique identifier
to represent the user, this should be a value that is used to identify your user in your application such
as database ID, email address, or UUID.
With the EnaLog Python SDK this looks like this:
enalog = EnaLog(api_token=api_token)
res = enalog.push_event(event={
"project": "demo",
"name": "user-attributes",
"user_id": "sam@demo.app"
})
Pushing events with a different user ID will create a new user
User Attributes
Users can also have Attributes in EnaLog which allows you to include additional information about your user.
This is easily done by including the user_attributes
key with an event and then passing a key value object
containing your user attributes.
Building on from the example above, this can be done with the EnaLong Python SDK like this:
enalog = EnaLog(api_token=api_token)
res = enalog.push_event(event={
"project": "demo",
"name": "user-attributes",
"user_id": "sam@demo.app",
"user_attributes": {
"name": "Sam",
"user_since": "28/02/2022"
}
})