Skip to navigation

Identify users

View as Markdown
Legacy Tracker Documentation

For the legacy tracker doc, check our guide here.

Identify a user through the identify() function

Use the Brevo.identify() method to identify users who visited your website. It works as follows:

  • Once installed, the Brevo tracker adds a cookie for each of your visitors.
  • When Brevo.identify() is called, Brevo associates this cookie with a contact using the identifier you provide.
  • If Brevo.identify() is called for a contact that already exists, Brevo updates its contact attributes based on the payload of the call.

To identify your visitor, call the Brevo.identify function like this:

Brevo.push(function () {
Brevo.identify({
identifiers: {
email_id: "jane@example.com"
},
attributes: { /*optional*/
FIRSTNAME: "Jane",
LASTNAME: "Doe",
AGE: 32,
GENDER: "FEMALE"
},
});
});

Identifiers

The identifiers object tells Brevo which contact the visitor is. At least one identifier must be provided.

KeyTypeDescription
email_idStringEmail address of the visitor
ext_idStringExternal identifier (e.g. CRM ID, loyalty ID)
phone_idStringPhone number in international format
whatsapp_idStringWhatsApp number in international format
landline_number_idStringLandline number in international format

You can combine multiple identifiers in a single call.

Attributes

KeyTypeDescription
attributesJSON objectJSON object holding your visitor’s contact attribute values. Optional.

When sending attributes:

  • If the contact does not exist yet, Brevo creates it with the attributes you send.
  • If the contact already exists, Brevo updates it.
  • If an attribute in the call does not exist in your contact database, Brevo ignores it.
Properties and contact attributes

Contact attributes and the data you pass in the properties object overlap.

If the contact exists in Brevo, attributes matching Properties are updated each time Brevo.identify() is called.

properties that do not correspond to existing contact attributes can only be used in your automation workflows, unless you add them as attributes from your Contacts section or via the Brevo API.

Examples

Identify by email

Brevo.push(function () {
Brevo.identify({
identifiers: {
email_id: "John.Doe@email.com"
},
attributes: {
FIRSTNAME: "John",
LASTNAME: "Doe"
}
});
});

Identify by external ID (no email required)

Brevo.push(function () {
Brevo.identify({
identifiers: {
ext_id: "customer_98765"
},
attributes: {
FIRSTNAME: "Jane",
LASTNAME: "Doe"
}
});
});

Identify by phone number

Brevo.push(function () {
Brevo.identify({
identifiers: {
phone_id: "+33612345678"
}
});
});

Combine multiple identifiers

Brevo.push(function () {
Brevo.identify({
identifiers: {
email_id: "jane@example.com",
ext_id: "user_12345"
},
attributes: {
FIRSTNAME: "Jane",
LASTNAME: "Doe"
}
});
});

The legacy string form Brevo.identify('email@example.com') continues to work and is equivalent to passing identifiers: { email_id: 'email@example.com' }.