Skip to content

Commit 642ae5c

Browse files
committed
update to new google analytics tag
1 parent 0aefbee commit 642ae5c

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

.ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.5.0

_includes/scripts.html

+8-12
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,13 @@
2525
<script src="/js/new-age.min.js"></script>
2626

2727
{% if site.google_analytics %}
28-
<script type="text/javascript">
29-
var _gaq = _gaq || [];
30-
_gaq.push(['_setAccount', '{{ site.google_analytics }}']);
31-
_gaq.push(['_trackPageview']);
32-
(function () {
33-
var ga = document.createElement('script');
34-
ga.type = 'text/javascript';
35-
ga.async = true;
36-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
37-
var s = document.getElementsByTagName('script')[0];
38-
s.parentNode.insertBefore(ga, s);
39-
})();
28+
<!-- Global site tag (gtag.js) - Google Analytics -->
29+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
30+
<script>
31+
window.dataLayer = window.dataLayer || [];
32+
function gtag(){dataLayer.push(arguments);}
33+
gtag('js', new Date());
34+
35+
gtag('config', '{{ site.google_analytics }}');
4036
</script>
4137
{% endif %}

0 commit comments

Comments
 (0)