Skip to content

Commit

Permalink
Added GA code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Bernal committed Jan 18, 2010
1 parent aaab4ac commit f42e7bb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/views/layouts/application.html.erb
Expand Up @@ -26,5 +26,16 @@
<%= yield %>
</div>
</div>
<% if defined?(GA_USER_ACCOUNT) %>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("<%= GA_USER_ACCOUNT %>");
pageTracker._trackPageview();
} catch(err) {}</script>
<% end %>
</body>
</html>

0 comments on commit f42e7bb

Please sign in to comment.