You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9543564
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ Since this is not a library, this changelog focuses on the changes that are rele
28
28
- Bounce-rate and average-time metrics now omit low-sample values from summary cards and breakdowns, with configurable minimum counts under `[limits]`.
29
29
- Added support for custom events
30
30
- Added support for custom properties
31
+
- Added tracker-wide custom properties and a hook to customize events before sending them
Copy file name to clipboardExpand all lines: packages/tracker/README.md
+42Lines changed: 42 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,43 @@ When the script is loaded directly in the browser, it will automatically send pa
36
36
37
37
Pageviews send a best-effort exit signal when the page becomes hidden. Set `data-exit="false"` to disable exit tracking.
38
38
39
+
Set `window.liwanProperties` before loading the tracker to include properties on every pageview and custom event. You can update or delete keys later, and properties passed to `event()` take precedence.
Globals in server-side environments are shared across requests. Pass request-specific properties to `event()` instead of setting global defaults.
58
+
59
+
To customize events, define a synchronous `window.liwanTransformEvent` function before the tracker loads. It runs for automatic pageviews and explicit `event()` calls, including custom events. The callback receives the normalized payload, including its `name`, sanitized URL, `entity_id`, and global properties, and should return the payload to send. Exit signals do not call the transformer. If you change the URL, avoid adding query parameters or fragments that contain personal data.
0 commit comments