Commit 9c3f1aa 1 parent 42edeb0 commit 9c3f1aa Copy full SHA for 9c3f1aa
File tree 4 files changed +26
-0
lines changed
4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ {%- if jekyll.environment == 'production' and site.analytics.enabled == true -%}
2
+ <!-- Global site tag (gtag.js) - Google Analytics -->
3
+ < script async src ="https://www.googletagmanager.com/gtag/js?id={{ site.analytics.google.tracking_id }} "> </ script >
4
+ < script >
5
+ window . dataLayer = window . dataLayer || [ ] ;
6
+ function gtag ( ) { dataLayer . push ( arguments ) ; }
7
+ gtag ( 'js' , new Date ( ) ) ;
8
+
9
+ gtag ( 'config' , '{{ site.analytics.google.tracking_id }}' ) ;
10
+ </ script >
11
+ {%- endif -%}
Original file line number Diff line number Diff line change 18
18
</ main >
19
19
20
20
{% include footer.html %}
21
+ {% include analytics.html %}
21
22
{% include scripts.html %}
22
23
23
24
</ body >
Original file line number Diff line number Diff line change @@ -63,6 +63,13 @@ collections:
63
63
disqus : your-short-name-disqus # Your website Shortname on disqus
64
64
65
65
66
+ # ## Analytics ###
67
+ analytics :
68
+ enabled : false # Set true to enable analytics
69
+ google :
70
+ tracking_id : your-google-tracking-id
71
+
72
+
66
73
# ## Defaults for collections ###
67
74
defaults :
68
75
- scope :
Original file line number Diff line number Diff line change @@ -35,6 +35,13 @@ collections:
35
35
output : true
36
36
37
37
38
+ # ## Analytics ###
39
+ analytics :
40
+ enabled : true
41
+ google :
42
+ tracking_id : google-tracking-id
43
+
44
+
38
45
# ## Defaults for collections ###
39
46
defaults :
40
47
- scope :
You can’t perform that action at this time.
0 commit comments