added code for analytics.rb