Track link clicks
Legacy Tracker Documentation
For the legacy tracker doc, check our guide here.
trackLink()
is the function used to track clicks on links on your website. You can use it like this:
Brevo.push([
"trackLink",
link, /* mandatory */
properties /* optional */
]);
Parameters are defined below:
Attribute | Datatype | Description | Value |
---|---|---|---|
link | DOM element | It is the DOM element that you want to track | document.getElementById('download_casestudy_a'); |
properties | JSON object | Describes the click context or the visitor’s state | { “title”: “Page title”} |
Implement
trackLink
after the tag
trackLink()
needs you to pass the DOM elements which should have been loaded before. Therefore it's better to implementtrackLink()
after the<body>
tag while making sure that your DOM elements are already loaded.
Example:
var link = document.getElementById('download_casestudy_a');
var properties = {'casestudy' : 'A'}
Brevo.push([
"trackLink",
link, /* mandatory */
properties /* optional */
]);
Updated about 2 months ago
What’s Next