Add GA code to layouts and invite pages. Do not track admins. Refs #183

This commit is contained in:
Pavel Chipiga 2012-02-13 18:42:11 +02:00
parent 2866014a6f
commit c6f9995b98
5 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,13 @@
<script type="text/javascript">
 var _gaq = _gaq || [];
 _gaq.push(['_setAccount', 'UA-29164163-1']);
 _gaq.push(['_trackPageview']);
 (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);
 })();
</script>

View File

@ -57,3 +57,4 @@
#sidebar #sidebar
= yield :sidebar = yield :sidebar
= render 'layouts/counters' unless current_user.try(:admin?)

View File

@ -12,3 +12,5 @@
#box #box
= render :partial => "layouts/flashes" = render :partial => "layouts/flashes"
= yield = yield
= render 'layouts/counters' unless current_user.try(:admin?)

View File

@ -109,5 +109,18 @@
</li> </li>
</ul> </ul>
</footer> </footer>
<script type="text/javascript">
 var _gaq = _gaq || [];
 _gaq.push(['_setAccount', 'UA-29164163-1']);
 _gaq.push(['_trackPageview']);
 (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);
 })();
</script>
</body> </body>
</html> </html>

View File

@ -55,5 +55,18 @@
</li> </li>
</ul> </ul>
</footer> </footer>
<script type="text/javascript">
 var _gaq = _gaq || [];
 _gaq.push(['_setAccount', 'UA-29164163-1']);
 _gaq.push(['_trackPageview']);
 (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);
 })();
</script>
</body> </body>
</html> </html>