hexo-theme-ayer/layout/_partial/google-analytics.ejs

11 lines
388 B
JavaScript
Raw Normal View History

2019-12-06 12:21:24 +00:00
<% if (theme.google_analytics){ %>
2022-05-23 08:36:09 +00:00
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=<%= theme.google_analytics %>"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '<%= theme.google_analytics %>');
2019-12-06 12:21:24 +00:00
</script>
<% } %>