Skip to content

Commit c35aee3

Browse files
committed
Add Google Analytics
1 parent ebd230d commit c35aee3

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

_includes/analytics.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--Global Site Tag (gtag.js) - Google Analytics -->
2+
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-107131347-1"></script>
3+
<script>
4+
window.dataLayer = window.dataLayer || [];
5+
function gtag(){dataLayer.push(arguments)};
6+
gtag('js', new Date());
7+
8+
gtag('config', 'UA-107131347-1');
9+
</script>
10+

_layouts/default.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
{% include footer.html %}
1717
{% include modals.html %}
1818
{% include js.html %}
19-
19+
{% if jekyll.environment == 'production' %}
20+
{% include analytics.html %}
21+
{% endif %}
2022
</body>
21-
</html>
23+
</html>

0 commit comments

Comments
 (0)