Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #3004 from krisquigley/analytics-patch-1

Update _google_analytics.html.erb
  • Loading branch information...
commit 0bbbc54f7910b8a5436ed7351bb4efb35f6f4c20 2 parents 29ab036 + 858474a
@parndt parndt authored
Showing with 7 additions and 8 deletions.
  1. +7 −8 core/app/views/refinery/_google_analytics.html.erb
View
15 core/app/views/refinery/_google_analytics.html.erb
@@ -2,14 +2,13 @@
<% unless local_request? or refinery_user? or page_code =~ /^(UA-xxxxxx-x)?$/ -%>
<!-- asynchronous google analytics snippet -->
<script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', '<%= page_code %>']);
- _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', '<%= page_code %>', 'auto');
+ ga('send', 'pageview');
</script>
+<!-- End Google Analytics -->
<% end -%>
Please sign in to comment.
Something went wrong with that request. Please try again.