Skip to content

Commit d02de8f

Browse files
committed
feat: add page_path
1 parent 9e42dbc commit d02de8f

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

blog/.vuepress/config.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,29 @@ module.exports = {
7575
// options for markdown-it-toc
7676
toc: { includeLevel: [1, 2] },
7777
},
78-
plugins: [
78+
head: [
7979
[
80-
'@vuepress/google-analytics',
80+
'script',
8181
{
82-
'ga': 'UA-124207676-2'
82+
async: true,
83+
src: 'https://www.googletagmanager.com/gtag/js?id=UA-124207676-2',
8384
}
85+
],
86+
[
87+
'script',
88+
{},
89+
`window.dataLayer = window.dataLayer || [];
90+
function gtag(){dataLayer.push(arguments);}
91+
gtag('js', new Date());
92+
gtag('config', 'UA-124207676-2', {'page_path': '/blog'});`
8493
]
8594
]
95+
// plugins: [
96+
// [
97+
// '@vuepress/google-analytics',
98+
// {
99+
// 'ga': 'UA-124207676-3'
100+
// }
101+
// ]
102+
// ]
86103
}

0 commit comments

Comments
 (0)