Track link clicks

View as Markdown
Legacy Tracker Documentation

For the legacy tracker doc, check our guide here.

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

Brevo.push([
"trackLink",
link, /* mandatory */
properties /* optional */
]);

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:

var link = document.getElementById('download_casestudy_a');
var properties = {'casestudy' : 'A'}
Brevo.push([
"trackLink",
link, /* mandatory */
properties /* optional */
]);