enhance page_view gtag

This commit is contained in:
geekgeekrun
2025-04-28 01:28:43 +08:00
parent 05702e773f
commit 28d2d34763
2 changed files with 4 additions and 3 deletions
+4 -1
View File
@@ -157,7 +157,10 @@ router.afterEach((to, from) => {
from_path: from.fullPath, from_path: from.fullPath,
to_path: to.fullPath to_path: to.fullPath
}) })
gtagRenderer('page_view') gtagRenderer('page_view', {
page_location: location.href,
page_title: document.title
})
}) })
export default router export default router
@@ -4,8 +4,6 @@ export function gtagRenderer(name, params: any = null) {
name, name,
params: { params: {
...(params ?? {}), ...(params ?? {}),
page_location: location.href,
page_title: document.title,
screen_w: window.screen?.width ?? null, screen_w: window.screen?.width ?? null,
screen_h: window.screen?.height ?? null, screen_h: window.screen?.height ?? null,
screen_dpr: window.devicePixelRatio screen_dpr: window.devicePixelRatio