由于统计域名无法访问,导致网页错乱,可以将统计js添加到页面加载完成后再加载,就不会影响页面了。
<!-- Global site tag (gtag.js) - Google Analytics -->
<!-- Modified By Ricardo (Tongtong) Liu -->
<!-- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXX-Y"></script> -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXX-Y');
window.addEventListener('load', function(){
var s = document.createElement('script');
s.src = "https://www.googletagmanager.com/gtag/js?id=UA-XXXXX-Y";
document.body.appendChild(s);
});
</script>