Install the Brevo tracker manually on your website [Advanced]

The Brevo tracker is a powerful tool that connects Brevo apps (such as Automations, Segments, and Conversations) to your website. It monitors your website in real-time, allowing you to use Brevo to respond as visitors take actions like visiting certain pages or submitting forms. This helps you better understand and engage with your contacts.

If a plugin is not available for your website, or if you're not using a tag management system like Google Tag Manager, you can manually install the script directly on your website.

❗️ Important
We recommend having a web developer install the script, as it typically takes just a few minutes.

Before you start

If you don't know what the Brevo tracker is and how it works, check our dedicated article What is the Brevo tracker and how to install it?.

Step 1: Configure your cookie settings

Before installing the Brevo tracker on your website, you need to configure your cookie settings and decide if you want to use first-party or third-party cookies:

  1. In Brevo, go to Automations > Settings > Tracking code.
  2. Enable the Identify and track visitors option.
  3. Select the type of cookies you want to use to track your website visitors:
    automations_brevo-tracker_cookies_en-us.jpg

    [Recommended] First-party cookies - Identify and track visitors through the links in your emails

    Only your website tracks your visitors, keeping user data private by preventing third-party from accessing it. When first-party cookies are enabled, Brevo will add the parameters _sc for marketing emails and _se for transactional emails at the end of URLs that redirect to your website.

    ➡️ To learn more, check our dedicated help article Troubleshooting - Implementing first-party cookies on your website.

    Third-party cookies - Identify visitors through a third-party tracker

    Choose to track your visitors through a third-party tracker.

Step 2: Copy the tracking code of the Brevo tracker and install it on your website

  1. Select the JS Tracker option.
    automations_brevo-tracker_js_option_en-us.jpg
  2. Copy the tracking code of the Brevo tracker under section A.
  3. Paste the tracking code into your website's code just before the </head> closing tag.
    💡 Good to know
    If you can't find a </head> closing tag, add the tracking code just before the </body> tag.

The Brevo tracker has been added to your website. 

Step 3: Identify your website visitors

Brevo can associate data collected by the Brevo tracker with a contact only if the visitor is identified. By default, when the Brevo tracker is installed, a cookie (visitor_id) is placed on the visitor's computer. The visitor can then be identified and associated with an existing contact in your Brevo account after they:

  • Create an account or log in to your website.
  • Click a link in a transactional email sent from Brevo, provided the link redirects to a page on your website.
  • Submit a form created in Brevo.

In other words, the Brevo tracker can only identify contacts who have performed these specific actions

(Optional) Identify other website visitors [Advanced]

The identify method is an advanced functionality that allows you to identify website visitors  who haven’t performed the actions described above. You can use multiple identifiers, such as email address, phone number, or WhatsApp number, to identify visitors. Additionally, this method allows you to update existing contact attributes in Brevo and create personalized automations.

➡️ To learn more about the identify method, check our dedicated developer documentation for JS and REST.

Step 4: (Optional) Track custom events

The Brevo tracker, combined with the identify method, is sufficient to build automations based on page visits or information collected during subscription. For more advanced tracking, you can create custom events to monitor specific actions by your website visitors, such as adding a product to their cart, completing a purchase, clicking a particular button, or finishing a lesson

➡️ To learn more, check our dedicated developer documentation for JS and REST.

Step 5: Verify that the Brevo tracker is working

Once you've installed the Brevo tracker on your website, verify that is it working and tracking your website visitors:

  1. Log in to your website and visit some pages to generate sample data for the Brevo tracker to track.
  2. In Brevo, go back to Automations > Settings > Tracking code.
  3. Click Verify at the bottom of the page.

You can now use the Brevo tracker to monitor your website activity in real-time, install our Conversations chat widget, create automations based on pages views, and more.

💡 Good to know
If the Brevo tracker doesn't work, you'll see the error message "❗ We could not detect the script, Please try to install it again.". In that case, check your website's code and try visiting some pages on your website again to generate new sample data. If you have a question, feel free to contact our support team by creating a ticket from your account.

⏭️ What's next?

🤔 Have a question?

If you have a question, feel free to contact our support team by creating a ticket from your account. If you don't have an account yet, you can contact us here.

If you’re looking for help with a project using Brevo, we can match you with the right certified Brevo expert partner.

💬 Was this article helpful?

2 out of 5 found this helpful