> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.brevo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.brevo.com/_mcp/server.

# Track link clicks

#### Legacy Tracker Documentation

For the legacy tracker doc, check our guide [here](https://tracker-doc.brevo.com/docs/getting-started-1).

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

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

Parameters:

| Attribute    | Datatype    | Description                                        | Value                                              |
| :----------- | :---------- | :------------------------------------------------- | -------------------------------------------------- |
| `link`       | DOM element | The DOM element 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()` 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:

```javascript
var link = document.getElementById('download_casestudy_a');

var properties = {'casestudy' : 'A'}

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