Skip to content

Commit 2f6bea2

Browse files
committed
Updated documentation
1 parent 4efc671 commit 2f6bea2

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

app/javascript/matomo_tracking.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
//
66
// CLICK TRACKING
77
// Add `data-matomo-click="Category, Action, Name"` to any element to track
8-
// clicks as Matomo events. The Name segment is optional. We have a convention
9-
// of using semicolons inside Name to divide multiple values.
8+
// clicks as Matomo events. We have a convention of using semicolons inside Name
9+
// to divide multiple values. This is purely for consistency.
1010
//
1111
// This tracking can be placed directly on an interactive element.
1212
// Tracking also works if placed on a container. The script will look
@@ -16,22 +16,22 @@
1616
//
1717
// Examples:
1818
// <a href="/file.pdf" data-matomo-click="Downloads, PDF Click, My Paper">Download</a>
19-
// <button data-matomo-click="Search, Boolean Toggle">AND/OR</button>
19+
// <button data-matomo-click="Search, Boolean Toggle, Off">AND/OR</button>
2020
//
2121
// Event delegation on `document` means this works for elements loaded
2222
// asynchronously (Turbo frames, content-loader, etc.) without re-binding.
2323
//
2424
// SEEN TRACKING
2525
// Add `data-matomo-seen="Category, Action, Name"` to any element to fire a
26-
// Matomo event when that element becomes visible in the viewport. The Name
27-
// segment is optional. We have a convention of using semicolons inside Name
28-
// to divide multiple values. Each element fires at most once per page load.
26+
// Matomo event when that element becomes visible in the viewport. We have
27+
// a convention of using semicolons inside Name to divide multiple values.
28+
// Each element fires at most once per page load.
2929
// Works for elements present on initial page load and for elements injected
3030
// later by Turbo frames or async content loaders.
3131
//
3232
// Examples:
3333
// <div data-matomo-seen="Impressions, Result Card, Alma">...</div>
34-
// <a data-matomo-seen="Promotions, Banner Shown">...</a>
34+
// <a data-matomo-seen="Promotions, Banner Shown, Banner Type">...</a>
3535
//
3636
// DYNAMIC VALUES
3737
// Wrap a helper name in double curly braces anywhere inside a segment to have

0 commit comments

Comments
 (0)