Skip to content

Commit

Permalink
GA update and GDPR compliance (SpinaCMS#362)
Browse files Browse the repository at this point in the history
* Migrate from ga.js to analytics.js

* anonymizeIp in google analytics for GDPR compliance
  • Loading branch information
Dan Mitchell authored and Bramjetten committed Apr 30, 2018
1 parent 53ef2a7 commit d7865b1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/views/spina/shared/_analytics.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<%= current_account.google_analytics %>']);
_gaq.push(['_trackPageview']);
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
ga('create', '<%= current_account.google_analytics %>', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>

0 comments on commit d7865b1

Please sign in to comment.