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!

Remove previous page parameter

Blue Mouse6df4d8aca7b0
diff --git a/src/Lib.ts b/src/Lib.ts
index 5d5ed42a9..bed8977a2 100644
--- a/src/Lib.ts
+++ b/src/Lib.ts
@@ -58,7 +58,6 @@ export interface IPageViewPayload {
te: string | undefined
co: string | undefined
pg: string | null | undefined
- prev: string | null | undefined
/** Pageview-related metadata object with string values. */
meta?: {
@@ -382,41 +381,6 @@ export class Lib {
}
}
- private getPreviousPage(): string | null {
- // Assuming that this function is called in trackPage and this.activePage is not overwritten by new value yet
- // That method of getting previous page works for SPA websites
- if (this.activePage) {
- return this.activePage
- }
-
- // Checking if URL is supported by the browser (for example, IE11 does not support it)
- if (typeof URL === 'function') {
- // That method of getting previous page works for websites with page reloads
- const referrer = getReferrer()
-
- if (!referrer) {
- return null
- }
-
- const { host } = location
-
- try {
- const url = new URL(referrer)
- const { host: refHost, pathname } = url
-
- if (host !== refHost) {
- return null
- }
-
- return pathname
- } catch {
- return null
- }
- }
-
- return null
- }
-
private trackPage(pg: string, unique: boolean = false): void {
if (!this.pageData) return
this.pageData.path = pg
@@ -433,7 +397,6 @@ export class Lib {
perf: IPerfPayload | {},
evokeCallback?: boolean,
): void {
- const prev = this.getPreviousPage()
const privateData = {
pid: this.projectID,
perf,
@@ -449,7 +412,6 @@ export class Lib {
ca: getUTMCampaign(),
te: getUTMTerm(),
co: getUTMContent(),
- prev,
...payload,
}