|
12 | 12 | // Tracking also works if placed on a container. The script will look |
13 | 13 | // for any interactive elements inside the container. |
14 | 14 | // |
15 | | -// Interactive elemenets are defined as elements: a, button, input, select, textarea |
| 15 | +// Interactive elements are defined as elements: a, button, input, select, textarea |
16 | 16 | // |
17 | 17 | // Examples: |
18 | 18 | // <a href="/file.pdf" data-matomo-click="Downloads, PDF Click, My Paper">Download</a> |
|
39 | 39 | // must be registered on `window.MatomoHelpers` (see bottom of this file). |
40 | 40 | // Multiple tokens in one segment are supported. |
41 | 41 | // |
42 | | -// Convention is to only use these in the "Name" segement to provide more context. |
| 42 | +// Convention is to only use these in the "Name" segment to provide more context. |
43 | 43 | // Avoid using inside Category or Action to improve the hierarchy of Matomo dashboards. |
44 | 44 | // |
45 | 45 | // Examples: |
@@ -169,6 +169,17 @@ document.querySelectorAll("[data-matomo-seen]").forEach((el) => { |
169 | 169 | // Matomo native content tracking |
170 | 170 | // --------------------------------------------------------------------------- |
171 | 171 |
|
| 172 | +// Core Matomo includes "Content Tracking" |
| 173 | +// You can use these attributes to track content impressions and interactions. |
| 174 | +// See documentation for details (https://matomo.org/faq/how-to/how-do-i-markup-content-for-content-tracking/) |
| 175 | +// This file only ensures that these attributes are processed for asynchronously-inserted content. |
| 176 | +// |
| 177 | +// Attributes for content tracking (native to Matomo): |
| 178 | +// * data-track-content - Defines a content block to track |
| 179 | +// * data-content-name - Gives a name for the content block (appears in Matomo Dashboard) |
| 180 | +// * data-content-piece - Names a piece of content to track interactions on (appears in Matomo Dashboard) |
| 181 | +// * data-content-target - Specifies the target of the content interaction (appears in Matomo Dashboard) |
| 182 | + |
172 | 183 | // Matomo's built-in content tracking (data-track-content / data-content-name / |
173 | 184 | // data-content-piece) only scans the DOM at page load. For content injected |
174 | 185 | // asynchronously (e.g. by the content-loader Stimulus controller), we must |
|
0 commit comments