|
|
|
@ -127,12 +127,17 @@ |
|
|
|
|
|
|
|
|
|
<% if (config.google_analytics_key) { %> |
|
|
|
|
<!-- Global site tag (gtag.js) - Google Analytics --> |
|
|
|
|
<script async src="https://www.googletagmanager.com/gtag/js?id=<%- config.google_analytics_key %>"></script> |
|
|
|
|
<script> |
|
|
|
|
setTimeout(function() { |
|
|
|
|
let script = document.createElement('script'); |
|
|
|
|
script.src = "https://www.googletagmanager.com/gtag/js?id=<%- config.google_analytics_key %>"; |
|
|
|
|
script.defer=true; |
|
|
|
|
document.body.appendChild(script); |
|
|
|
|
window.dataLayer = window.dataLayer || []; |
|
|
|
|
function gtag(){dataLayer.push(arguments);} |
|
|
|
|
gtag('js', new Date()); |
|
|
|
|
gtag('config', '<%- config.google_analytics_key %>'); |
|
|
|
|
}, 5000); |
|
|
|
|
</script> |
|
|
|
|
<% } %> |
|
|
|
|
<% if (config.baidu_analytics_key) { %> |
|
|
|
@ -140,10 +145,13 @@ |
|
|
|
|
<script> |
|
|
|
|
var _hmt = _hmt || []; |
|
|
|
|
(function() { |
|
|
|
|
var hm = document.createElement("script"); |
|
|
|
|
hm.src = "https://hm.baidu.com/hm.js?<%= config.baidu_analytics_key %>"; |
|
|
|
|
var s = document.getElementsByTagName("script")[0]; |
|
|
|
|
s.parentNode.insertBefore(hm, s); |
|
|
|
|
setTimeout(function() { |
|
|
|
|
var hm = document.createElement("script"); |
|
|
|
|
hm.src = "https://hm.baidu.com/hm.js?<%= config.baidu_analytics_key %>"; |
|
|
|
|
hm.defer=true; |
|
|
|
|
var s = document.getElementsByTagName("script")[0]; |
|
|
|
|
s.parentNode.insertBefore(hm, s); |
|
|
|
|
}, 5000); |
|
|
|
|
})(); |
|
|
|
|
</script> |
|
|
|
|
<% } %> |
|
|
|
|