From 178fe3ab1d8d32530b85a02621a6c66c306c0c66 Mon Sep 17 00:00:00 2001 From: ayan Date: Wed, 8 May 2024 18:05:41 +0530 Subject: [PATCH] fix: update load to DOMContentLoaded event for page view --- src/event/page-view-event.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/event/page-view-event.ts b/src/event/page-view-event.ts index aab3614..1705914 100644 --- a/src/event/page-view-event.ts +++ b/src/event/page-view-event.ts @@ -19,7 +19,7 @@ let _hasInitialPageViewOccurred: boolean = false; let _debounce: boolean = false; export function initPageViewEventHandler(): void { - resolveWindow()?.addEventListener("load", () => pageViewObserver()); + resolveWindow()?.addEventListener("DOMContentLoaded", () => pageViewObserver()); } export function pageViewObserver(): void {