* VRFS-695 - GA integrated trivially for all 3 environments

This commit is contained in:
Seth Call 2013-09-23 18:06:25 +00:00
parent 6c3958dc9f
commit 5bbea091bb
6 changed files with 32 additions and 0 deletions

View File

@ -38,5 +38,6 @@
<% end %>
</div>
<%= yield %>
<%= render "shared/ga" %>
</body>
</html>

View File

@ -17,5 +17,6 @@
</head>
<body>
<%= yield %>
<%= render "shared/ga" %>
</body>
</html>

View File

@ -54,5 +54,6 @@
</div>
</div>
<%= render "shared/ga" %>
</body>
</html>

View File

@ -37,6 +37,7 @@
<%= render "clients/footer" %>
</div>
<%= render "shared/ga" %>
<!-- version info: <%= version %> -->
</body>
</html>

View File

@ -0,0 +1,26 @@
<% if current_user.nil? || !current_user.admin? # remove admin users from GA %>
<script>
(function(context) {
if(context.jamClient) {
var currentVersion = context.jamClient.ClientUpdateVersion();
if(currentVersion == null || currentVersion.indexOf("Compiled") > -1) {
// don't track dev version of the client
return;
}
}
(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');
<% if Rails.env == "development" %>
ga('create', '<%= Rails.application.config.ga_ua %>', { 'cookieDomain': 'none' });
<% else %>
ga('create', '<%= Rails.application.config.ga_ua %>', 'jamkazam.com');
<% end %>
ga('send', 'pageview');
})(window);
</script>
<% end %>

View File

@ -151,5 +151,7 @@ if defined?(Bundler)
config.bugsnag_key = "4289fc981c8ce3eb0969003c4f498b01"
config.bugsnag_notify_release_stages = ["production"] # add 'development' if you want to test a bugsnag feature locally
config.ga_ua = 'UA-44184562-2' # google analytics
end
end