Skip to content

Commit 63c4568

Browse files
committed
Cleaning up documentation
1 parent 47c42c8 commit 63c4568

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

app/javascript/matomo_tracking.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// Tracking also works if placed on a container. The script will look
1313
// for any interactive elements inside the container.
1414
//
15-
// Interactive elemenets are defined as elements: a, button, input, select, textarea
15+
// Interactive elements are defined as elements: a, button, input, select, textarea
1616
//
1717
// Examples:
1818
// <a href="/file.pdf" data-matomo-click="Downloads, PDF Click, My Paper">Download</a>
@@ -39,7 +39,7 @@
3939
// must be registered on `window.MatomoHelpers` (see bottom of this file).
4040
// Multiple tokens in one segment are supported.
4141
//
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.
4343
// Avoid using inside Category or Action to improve the hierarchy of Matomo dashboards.
4444
//
4545
// Examples:
@@ -169,6 +169,17 @@ document.querySelectorAll("[data-matomo-seen]").forEach((el) => {
169169
// Matomo native content tracking
170170
// ---------------------------------------------------------------------------
171171

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+
172183
// Matomo's built-in content tracking (data-track-content / data-content-name /
173184
// data-content-piece) only scans the DOM at page load. For content injected
174185
// asynchronously (e.g. by the content-loader Stimulus controller), we must

0 commit comments

Comments
 (0)