Permalink
Browse files

Only add analytics code to unlogged users and untracked logged users.

* Also removed logic that took groups into account.
  • Loading branch information...
1 parent 01c3eed commit faf7560ada08e88a4d8f202a2f4f876ae8c63a18 @mpereira mpereira committed Nov 11, 2011
Showing with 4 additions and 12 deletions.
  1. +4 −12 app/views/shared/_analytics.haml
@@ -1,13 +1,5 @@
-- if Rails.env.production? && !AppConfig.analytics_id.blank? && (!current_group.has_custom_analytics || current_group.analytics_id.blank?)
- = googlean_script(AppConfig.analytics_id, AppConfig.googlean_domain)
+- if Rails.env.production? && (!current_user || current_user && current_user.tracked?)
+ - if AppConfig.analytics_id && AppConfig.googlean_domain
+ = googlean_script(AppConfig.analytics_id, AppConfig.googlean_domain)
-- elsif Rails.env.production? && current_group.has_custom_analytics && current_group.analytics_vendor == 'googlean' && request.domain == AppConfig.domain
-
- = googlean_script(AppConfig.analytics_id, AppConfig.googlean_domain)
- = googlean_script(current_group.analytics_id, current_group.domain)
-
-- elsif Rails.env.production? && current_group.has_custom_analytics && current_group.analytics_vendor == 'googlean' && request.domain != AppConfig.domain
-
- = googlean_script(current_group.analytics_id, current_group.domain)
-
-~ AppConfig.analytics_javascripts if Rails.env.production?
+ ~ AppConfig.analytics_javascripts

0 comments on commit faf7560

Please sign in to comment.