Skip to content

Commit ade270e

Browse files
Add google analytics
1 parent ac83831 commit ade270e

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

_configs/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ twitter: https://twitter.com/syclopseu
2121
youtube: https://www.youtube.com/@syclopseu
2222

2323
# Google Analytics Token
24-
ga: ''
24+
ga: 'G-BKNJ7GJM13'
2525

2626
# List of consortium members (in alphabetical order)
2727
consortium_members:

_layouts/page.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,37 @@
5151
https://fonts.googleapis.com;
5252
script-src
5353
'self'
54+
'unsafe-inline'
5455
https://code.jquery.com
5556
https://www.googletagmanager.com
5657
https://cdn.usefathom.com/script.js;
5758
connect-src
5859
'self'
60+
https://*.google-analytics.com
61+
https://*.analytics.google.com
5962
https://cdn.usefathom.com;
6063
img-src
6164
'self'
6265
https:
6366
http:
6467
data:
68+
https://www.google-analytics.com
6569
https://cdn.usefathom.com;
6670
frame-src
6771
'self'
6872
https://www.youtube.com;" http-equiv="Content-Security-Policy" />
73+
74+
{% if site.ga and site.ga != "" %}
75+
<!-- Google tag (gtag.js) -->
76+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.ga }}"></script>
77+
<script>
78+
window.dataLayer = window.dataLayer || [];
79+
function gtag() { dataLayer.push(arguments); }
80+
gtag('js', new Date());
81+
82+
gtag('config', '{{ site.ga }}');
83+
</script>
84+
{% endif %}
6985
</head>
7086

7187
<body>

0 commit comments

Comments
 (0)