<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');
</script>
其中,“GA_MEASUREMENT_ID”为您的Analytics跟踪ID,需要将其替换为您自己的ID;
4. 保存文件,刷新网站查看是否生效。