From c43d4aa5f7d601fe739fa718bcc18224d4172bce Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Sat, 24 Jan 2026 19:45:52 -0800 Subject: [PATCH] fix: align gtm page view payload --- src/router.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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) {