Skip to content

Commit ed17aef

Browse files
committed
add analytics following academicpages#265
1 parent f9864a5 commit ed17aef

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed
+7-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
<!-- start custom analytics snippet -->
2-
3-
<!-- end custom analytics snippet -->
1+
<!-- Google Tag Manager -->
2+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
3+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
4+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
5+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
6+
})(window,document,'script','dataLayer','GTM-WD2MJZN8');</script>
7+
<!-- End Google Tag Manager -->

_includes/scripts.html

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<script src="{{ base_path }}/assets/js/main.min.js"></script>
22

3-
{% include analytics.html %}
43
{% include /comments-providers/scripts.html %}

_layouts/default.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77
<!doctype html>
88
<html lang="{{ site.locale | slice: 0,2 }}" class="no-js">
99
<head>
10+
{% include analytics.html %}
1011
{% include head.html %}
1112
{% include head/custom.html %}
1213
</head>
1314

1415
<body>
15-
16+
<!-- Google Tag Manager (noscript) -->
17+
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WD2MJZN8"
18+
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
19+
<!-- End Google Tag Manager (noscript) -->
1620
{% include browser-upgrade.html %}
1721
{% include masthead.html %}
1822

0 commit comments

Comments
 (0)