Track link clicks

Legacy Tracker Documentation

For the legacy tracker doc, check our guide here.

Use trackLink() to track clicks on links on your website:

1Brevo.push([
2 "trackLink",
3 link, /* mandatory */
4 properties /* optional */
5]);

Parameters:

AttributeDatatypeDescriptionValue
linkDOM elementThe DOM element you want to trackdocument.getElementById(‘download_casestudy_a’);
propertiesJSON objectDescribes the click context or the visitor’s state{ "title": "Page title" }

Implement trackLink after the tag

trackLink() requires DOM elements to be loaded before it runs. Implement trackLink() after the <body> tag and make sure the relevant DOM elements are already loaded.

Example:

1var link = document.getElementById('download_casestudy_a');
2
3var properties = {'casestudy' : 'A'}
4
5Brevo.push([
6 "trackLink",
7 link, /* mandatory */
8 properties /* optional */
9]);