Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

send additional data along with the custom event

Blue Mouseae5d2a924296
diff --git a/src/Lib.ts b/src/Lib.ts
index d91f544fe..0e0dde23a 100644
--- a/src/Lib.ts
+++ b/src/Lib.ts
@@ -75,6 +75,7 @@ export class Lib {
private pageData: PageData | null = null
private pageViewsOptions: PageViewsOptions | null | undefined = null
private perfStatsCollected: Boolean = false
+ private activePage: string | null = null
constructor(private projectID: string, private options?: LibOptions) {
this.trackPathChange = this.trackPathChange.bind(this)
@@ -88,6 +89,13 @@ export class Lib {
const data = {
pid: this.projectID,
+ pg: this.activePage,
+ lc: getLocale(),
+ tz: getTimezone(),
+ ref: getReferrer(),
+ so: getUTMSource(),
+ me: getUTMMedium(),
+ ca: getUTMCampaign(),
...event,
}
this.sendRequest('custom', data)
@@ -210,6 +218,7 @@ export class Lib {
if (this.checkIgnore(pg)) return
+ this.activePage = pg
const perf = this.getPerformanceStats()
const data = {