Skip to content

Commit e1ed3c1

Browse files
committed
added google analytics to all site pages
1 parent 29c7a38 commit e1ed3c1

File tree

4 files changed

+33
-25
lines changed

4 files changed

+33
-25
lines changed

essays.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,16 @@
2121
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
2222
<script src="./js/main.js"/></script>
2323
<script src="./js/analytics.js"/></script>
24-
<!-- Google Analytics -->
24+
<!-- Global site tag (gtag.js) - Google Analytics -->
25+
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-72294820-1"></script>
2526
<script>
26-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
27-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
28-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
29-
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
27+
window.dataLayer = window.dataLayer || [];
28+
function gtag(){dataLayer.push(arguments);}
29+
gtag('js', new Date());
3030

31-
ga('create', 'UA-72323910-2', 'auto');
32-
ga('send', 'pageview');
31+
gtag('config', 'UA-72294820-1');
3332
</script>
34-
<!-- End Google Analytics -->
33+
3534
</head>
3635
<body id="essays">
3736
<section class="writing">

index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
2222
<script src="./js/main.js"/></script>
2323
<script src="./js/analytics.js"/></script>
24-
<!-- Google Analytics -->
25-
<script>
26-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
27-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
28-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
29-
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
24+
<!-- Global site tag (gtag.js) - Google Analytics -->
25+
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-72294820-1"></script>
26+
<script>
27+
window.dataLayer = window.dataLayer || [];
28+
function gtag(){dataLayer.push(arguments);}
29+
gtag('js', new Date());
30+
31+
gtag('config', 'UA-72294820-1');
32+
</script>
3033

31-
ga('create', 'UA-72294820-1', 'auto');
32-
ga('send', 'pageview');
33-
</script>
3434
</head>
3535

3636
<body>

poems.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,16 @@
2727
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
2828
<script src="./js/main.js"/></script>
2929
<script src="./js/analytics.js"/></script>
30-
<!-- Google Analytics -->
30+
<!-- Global site tag (gtag.js) - Google Analytics -->
31+
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-72294820-1"></script>
3132
<script>
32-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
33-
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
34-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
35-
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
33+
window.dataLayer = window.dataLayer || [];
34+
function gtag(){dataLayer.push(arguments);}
35+
gtag('js', new Date());
3636

37-
ga('create', 'UA-72323910-2', 'auto');
38-
ga('send', 'pageview');
37+
gtag('config', 'UA-72294820-1');
3938
</script>
40-
<!-- End Google Analytics -->
39+
4140
</head>
4241
<body id="poems">
4342
<section class="writing">

secrets.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@
77
<script src="./js/url.js"></script>
88
<!-- Webpage Icon -->
99
<link rel="shortcut icon" href="./assets/images/icon.png" type="image/png">
10+
<!-- Global site tag (gtag.js) - Google Analytics -->
11+
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-72294820-1"></script>
12+
<script>
13+
window.dataLayer = window.dataLayer || [];
14+
function gtag(){dataLayer.push(arguments);}
15+
gtag('js', new Date());
16+
17+
gtag('config', 'UA-72294820-1');
18+
</script>
19+
1020
</head>
1121
<body>
1222
</body>

0 commit comments

Comments
 (0)