lib/orange-more/analytics/middleware/analytics.rb in orange-0.2.11 vs lib/orange-more/analytics/middleware/analytics.rb in orange-0.3.0

- old
+ new

@@ -4,11 +4,11 @@ class Analytics < Base # Passes packet then parses the return def packet_call(packet) pass packet - unless packet['route.context'] != :live - ga_key = orange.options['google_analytics_key']; + ga_key = orange.options['google_analytics_key'] || false + if packet['route.context'] == :live && ga_key ga = "<script type=\"text/javascript\"> var _gaq = _gaq || []; _gaq.push(['_setAccount', '"+ga_key+"']); _gaq.push(['_trackPageview']); \ No newline at end of file