# valid Google Analytics code and changing 'false' to 'true'
##############################################################################
google_analytics.enabled = 'true';
-google_analytics.code = 'UA-66988802-1';
+google_analytics.code = 'G-GVGQ37XH17';
##############################################################################
# Ebook API integration
[%- PROCESS "opac/parts/header.tt2";
IF google_analytics.enabled == 'true' %]
-<!-- http://www.google.com/support/googleanalytics/bin/answer.py?answer=174090 -->
-<script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', '[% google_analytics.code %]']);
- _gaq.push(['_trackPageview']);
+<!-- Google tag (gtag.gs) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=[% google_analytics.code %]"></script>
+<script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag(){dataLayer.push(arguments);}
+ gtag('js', new Date());
- (function() {
- var ga = document.createElement('script');
- ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('oils:' == document.location.protocol || 'https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(ga, s);
- })();
+ gtag('config', '[% google_analytics.code %]');
</script>
[%- END %]