Detailed user
event guide
The user
event is a fundamental aspect of user analytics, enabling consistent tracking and reference across their lifetime.
Whether you’re dealing with registered users or anonymous visitors, the user
event helps you associate meaningful data with each individual.
This documentation provides detailed guidance on utilizing the user
event to enrich
your user data for more personalized and insightful analytics.
First of all, you don’t need to fire an user
event for every user action. Instead, you should fire it when
you first learn about a user, and then update the user’s information as it changes (for example, when they update their profile, or when they first register).
When you fire a user
event using the Edgee SDK or Data Layer, we securely process the user data at the edge and make sure all subsequent events are bound to that user.
Here’s how it works across different platforms:
This architecture ensures that all subsequent page
or track
events are seamlessly enriched with the user’s data. As a result, actions can be properly attributed, providing a complete and accurate view of user behavior.
In addition to that, some components support the user event natively, such as Amplitude and Segment.
For these components - in addition to enriching the page
and track
events for them as well - every time you make a user
call, Edgee will send the appropriate event to the component (e.g. identify
for Segment).
user
eventThe user
event is particularly useful in scenarios where you collect information about a user without having a definitive userId
, such as:
The user
event collects the following fields about the user:
Field | Type | Description |
---|---|---|
user_id | String | A unique identifier for the user, typically from your own user database. |
anonymous_id | String | An alternative identifier used when a user_id is not available, ensuring that user actions can still be collected anonymously. |
properties | Object | Free-form dictionary of properties of the user |
Privacy Notice: This method and all the fields it collects are subject to data privacy regulations. When collecting user data, always prioritize user privacy and data protection. Ensure that you are compliant with relevant data privacy regulations and obtain user consent before collecting any personal information.
user
event?There are two ways to collect the user
event:
Edgee collects the user
event automatically each time it receives a Data Layer with a user
event.
Here’s a breakdown of how to structure the Data Layer:
The user
event can be collected manually by calling the edgee.user()
method via the Edgee SDK.
Here’s a breakdown of how to structure an user
call:
As usual, you can optionally specify the components where the event should be sent. If the components parameter is not
specified, Edgee will look at data_collection.components
in the Data Layer. If not defined, the event will be sent to all your components.
The edgee.user()
method expect two optionals parameters:
field | type | description | |
---|---|---|---|
user_obj | optional | object|String | A free-form dictionary object containing details of the user event. This object can include all the following optional fields: user_id , anonymoudId , and properties . You can also provide a string that will be used as the user_id field. |
components | optional | object | Specifies which analytics components should receive the event data. This allows for targeted data sending based on your configured components within the Edgee platform. |
user
Eventsuser_id
versus anonymous_id
and stick to it.