Skip to content

Commit 1264fe5

Browse files
committed
Setting up Google Analytics
Followed these instructions academicpages#265
1 parent 05cffb0 commit 1264fe5

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ social:
7373

7474
# Analytics
7575
analytics:
76-
provider : "google-universal" # false (default), "google", "google-universal", "custom"
76+
provider : "custom" #"google-universal" # false (default), "google", "google-universal", "custom"
7777
google:
7878
tracking_id :
7979

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
<!-- start custom analytics snippet -->
2+
<!-- Google tag (gtag.js) -->
3+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5Q84E1GXB1"></script>
4+
<script>
5+
window.dataLayer = window.dataLayer || [];
6+
function gtag(){dataLayer.push(arguments);}
7+
gtag('js', new Date());
28

9+
gtag('config', 'G-5Q84E1GXB1');
10+
</script>
311
<!-- end custom analytics snippet -->

_includes/scripts.html

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

3-
{% include analytics.html %}
3+
<!-- {% include analytics.html %} -->
44
{% include /comments-providers/scripts.html %}

_layouts/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
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>

0 commit comments

Comments
 (0)