For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Help CenterAPI KeysStatusSign In
GuidesAPI ReferenceChangelog
GuidesAPI ReferenceChangelog
  • Getting started
    • Overview
    • Quickstart
    • Authentication
    • Rate limits
  • Messaging API
    • Send transactional email
    • Send transactional SMS
    • Send transactional WhatsApp
  • Marketing Platform
    • Manage your contacts
    • Track website activity
    • Send WhatsApp campaigns
    • Weekly event exports
  • Webhooks
    • Getting started
    • Conversations webhooks
    • Payment webhooks
    • Marketing webhooks
    • Transactional webhooks
    • Loyalty webhooks
    • Batched webhooks
    • Secure webhook calls
    • Meetings and phone webhooks
    • Push notification webhooks
    • Sales CRM webhooks
  • Conversations
    • Getting started
    • Customize the chat widget
    • JavaScript API reference
    • REST API reference
    • Conversations webhooks
  • eCommerce
    • Activate eCommerce app
    • Manage product categories
    • Manage products
    • Manage orders
    • Coupon collections
    • eCommerce tracker events
  • Loyalty
    • Overview
    • Set up a program
    • Enroll members
    • Credit & debit points
    • Read member data
    • Best practices
  • Custom Objects
    • Custom objects management
  • Brevo tracker and events
    • Getting started
    • JavaScript implementation
      • Identify users
      • Track page views
      • Track link clicks
      • Track custom events
    • REST implementation
    • Legacy tracker documentation
    • Events
  • Accounts and settings
    • Senders and domains
    • User activity logs
    • External feeds
    • Invited users
LogoLogo
Help CenterAPI KeysStatusSign In
On this page
  • Identify a user through the identify() function
Brevo tracker and eventsJavaScript implementation

Identify users

Was this page helpful?
Previous

Track page views

Next
Built with
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 an email.
  • 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:

1Brevo.push(function () {
2 Brevo.identify({
3 identifiers: {
4 email_id: "email" /*required*/
5 },
6 attributes: { /*optional*/
7 FIRSTNAME: "Jane",
8 LASTNAME: "Doe",
9 AGE: 32,
10 GENDER: "FEMALE"
11 },
12 });
13});

The parameters are defined below:

AttributeDatatypeDescriptionValue
email_idStringEmail address of the website visitor. Required.visitor@email.com
attributesJSON objectJSON object holding your visitor’s contact attribute values. Optional.Any of your visitor’s contact attributes. See example below.

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.

Example

1var email = "John.Doe@email.com"; /*required*/
2
3var properties = { /*optional*/
4 FIRSTNAME : "John",
5 LASTNAME : "Doe",
6 id : "10001",
7 plan : "diamond",
8};
9Brevo.push([
10 "identify", {
11 identifiers : {
12 email_id : email
13 },
14 attributes : properties
15 }
16]);