diff --git a/src/router.ts b/src/router.ts index 88f651899..ad5c93cf3 100644 --- a/src/router.ts +++ b/src/router.ts @@ -36,15 +36,14 @@ function getBasePath(): string { const basePath = getBasePath() -function pushPageView(to: RouteLocationNormalized): void { +function pushPageView(): void { if (!isCloud) return const dataLayer = window.dataLayer ?? (window.dataLayer = []) dataLayer.push({ event: 'page_view', page_location: window.location.href, - page_title: document.title, - page_path: to.fullPath + page_title: document.title }) } @@ -105,8 +104,8 @@ installPreservedQueryTracker(router, [ } ]) -router.afterEach((to) => { - pushPageView(to) +router.afterEach(() => { + pushPageView() }) if (isCloud) {