Identify users
Legacy Tracker Documentation
For the legacy tracker doc, check our guide here.
Identify a user through identify() function
The Brevo.identify() method is used to identify the users who visited your website. The way it works is the following:
- by default, once installed, the Brevo tracker adds a cookie for each of your visitors
- then, as soon as the Brevo.identify() function is called, Brevo associates this cookie with an email
- if you’re calling the Brevo.identify() function for a contact that already exists, we will update its contact attributes based on the payload of the call
If you wish to identify your visitor, you need to call the Brevo.identify
function like this:
Brevo.push(function () {
Brevo.identify({
identifiers: {
email_id: "email" /*required*/
},
attributes: { /*optional*/
FIRSTNAME: "Jane",
LASTNAME: "Doe",
AGE: 32,
GENDER: "FEMALE"
},
});
});
The parameters are defined below:
Attribute | Datatype | Description | Value |
---|---|---|---|
email_id | String | Email address of website visitor. This is a required parameter | [email protected] |
attributes | JSON object | JSON object that your visitor’s contact attributes’ values. This is an optional parameter | Any of your visitors contact attributes. See example below |
When sending attributes
:
- if the contact does not exist yet, we will create it with the attributes you’re sending
- if it exists already, we will update it
- if there is a mistake and a given attribute in the call is not an actual attribute in your contact database, we won’t take it into account
Properties and contacts attributes
There is some similarity between Contacts attributes and the information you can pass onto the
properties
object.If the contact exists in Brevo, its attributes matching Properties will be updated each time the Brevo.identify() method is called.
properties
that don't correspond to existing Contacts attributes can be used only in your automation workflows unless you add them as attributes from your Contacts section or via Brevo API.
Example
var email = "[email protected]"; /*required*/
var properties = { /*optional*/
FIRSTNAME : "John",
LASTNAME : "Doe",
id : "10001",
plan : "diamond",
};
Brevo.push([
"identify", {
identifiers : {
email_id : email
},
attributes : properties
}
]);
Updated 16 days ago