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 prev from trackPageview

Blue Mousee7d914f90e3e
diff --git a/src/index.ts b/src/index.ts
index 0d9bd7001..ac02b0758 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -99,14 +99,14 @@ export function trackError(payload: IErrorEventPayload): void {
*
* @deprecated This function is deprecated and will be removed soon, please use the `pageview` instead.
* @param pg Path of the page to track (this will be sent to the Swetrix API and displayed in the dashboard).
- * @param prev Path of the previous page.
+ * @param _prev Path of the previous page (deprecated and ignored).
* @param unique If set to `true`, only 1 event with the same ID will be saved per user session.
* @returns void
*/
-export function trackPageview(pg: string, prev?: string, unique?: boolean): void {
+export function trackPageview(pg: string, _prev?: string, unique?: boolean): void {
if (!LIB_INSTANCE) return
- LIB_INSTANCE.submitPageView({ pg, prev: prev || null }, Boolean(unique), {})
+ LIB_INSTANCE.submitPageView({ pg }, Boolean(unique), {})
}
export interface IPageviewOptions {