REST implementation

Legacy Tracker Documentation

For the legacy tracker doc, check our guide here.

This page and the ones that follow describe how to use the REST API to implement the Brevo Tracker features. The JS implementation is simpler and supports more capabilities. For example:

  1. The JavaScript tracker tracks page views automatically. With the REST implementation, you must send the events yourself.
  2. Brevo cannot track users who clicked on your emails through REST.
  3. With REST, you must pass an email in each call to identify users.
Combining the REST and JS implementations

You can combine both tracking technologies. For example, use JS on the client side to identify and track user behaviour on your website, and use REST on the server side to track orders.

Authentication

The REST implementation requires a key, shown as client_key below, to authenticate. Get it from your Brevo account.

1<script src="https://cdn.brevo.com/js/sdk-loader.js" async></script>
2<script>
3 // Version: 2.0
4 window.Brevo = window.Brevo || [];
5 Brevo.push([
6 "init",
7 {
8 client_key: "YOUR_CLIENT_KEY",
9 // Optional: Add other initialization options, see documentation
10 }
11 ]);
12</script>