Skip to content

Commit 72b3c3d

Browse files
committed
fix: google init.
1 parent c287aed commit 72b3c3d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/.vuepress/configs/head.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,15 @@ module.exports = [
9696
// 谷歌统计第二段代码
9797
['script', {}, `
9898
(function() {
99-
document.onreadystatechange = function() {
99+
document.addEventListener('readystatechange', function (e) {
100100
if (document.readyState == 'complete') {
101+
console.log('google init.');
101102
window.dataLayer = window.dataLayer || [];
102103
function gtag(){dataLayer.push(arguments);}
103104
gtag('js', new Date());
104105
gtag('config', 'UA-163860037-1');
105106
}
106-
}
107+
});
107108
})();
108109
`],
109110
// 广告系统

0 commit comments

Comments
 (0)