Skip to content

Commit 385d655

Browse files
committed
Add google analytics to docs site
1 parent 11b019e commit 385d655

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/_includes/base.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ <h1>{{ title | upcase }}</h1>
9393
});
9494
</script>
9595

96+
{% if project.node_env == 'production' %}
97+
<!-- Global site tag (gtag.js) - Google Analytics -->
98+
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-94030773-1"></script>
99+
<script type="text/javascript">
100+
window.dataLayer = window.dataLayer || [];
101+
function gtag(){dataLayer.push(arguments);}
102+
gtag('js', new Date());
103+
104+
gtag('config', 'UA-94030773-1');
105+
</script>
106+
{% endif %}
107+
96108
{% for link in scripts -%}
97109
<script type="text/javascript" src="{{ link | url }}"></script>
98110
{% endfor -%}

0 commit comments

Comments
 (0)