ActiveAnalytics alternatives and similar gems
Based on the "Analytics" category.
Alternatively, view active_analytics alternatives based on common mentions on social networks and blogs.
-
Impressionist
Rails Plugin that tracks impressions and page views -
Rack::Tracker
Tracking made easy: Don’t fool around with adding tracking and analytics partials to your app and concentrate on the things that matter. -
Gabba
Simple way to send server-side notifications to Google Analytics -
Analytical
Gem for managing multiple analytics services in your rails app. -
Staccato
Ruby library to perform server-side tracking into the official Google Analytics Measurement Protocol -
The Chartable Ruby gem
A lightweight and database-level Ruby library to transform any Active Record query into analytics hash ready for use with any chart library. -
RequestResponseStats
A Ruby gem which captures request response statistics such as cycle time, memory allocation, etc. for each request response cycle grouped in configurable granularity level. As this library makes use of TCP protocol, using DataDog or NewRelic RPM would be way faster because of UDP protocol.
Access the most powerful time series database as a service
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of ActiveAnalytics or a related project?
README
ActiveAnalytics
Simple traffic analytics for the win of privacy.
- NO cookies
- NO JavaScript
- NO third parties
- NO bullshit
ActiveAnalytics is a Rails engine directly mountable in your Ruby on Rails application. It doesn't reveal anything about specific visitors. It cannot be blocked by adblockers or other privacy-protecting extensions (and doesn't need to).
ActiveAnalytics lets you know about:
- Sources: What are the pages and domains that bring some traffic.
- Page views: What are the pages that are the most viewed in your application.
- Next/previous page: What are the entry and exit pages for a given page of your application.
Installation
Add this line to your application's Gemfile:
gem 'active_analytics'
Then execute bundle and run the migration:
bundle
rails active_analytics:install:migrations
rails db:migrate
Your controllers have to call ActiveAnalytics.record_request(request)
to record page views. The Rails way to achieve is to use a before_action
:
class ApplicationController < ActionController::Base
before_action :record_page_view
def record_page_view
# Add a condition to record only your canonical domain
# and use a gem such as crawler_detect to skip bots.
ActiveAnalytics.record_request(request)
end
end
In case you don't want to record all page views, because each application has sensitive URLs such as password reset and so on, simply define a skip_before_action :record_page_view
in the relevant controller.
Finally, just add the route to ActiveAnalytics dashboard at the desired endpoint:
mount ActiveAnalytics::Engine, at: "analytics" # http://localhost:3000/analytics
Authentication and permissions
ActiveAnalytics cannot guess how you handle user authentication, because it is different for all Rails applications. So you have to monkey patch ActiveAnalytics::ApplicationController
in order to inject your own mechanism. Create a file in config/initializers/active_analytics.rb
to add a before action :
# config/initializers/active_analytics.rb
require_dependency "active_analytics/application_controller"
module ActiveAnalytics
class ApplicationController
before_action :require_admin
def require_admin
# This example supposes there are current_user and User#admin? methods
raise ActionController::RoutingError.new("Not found") unless current_user.try(:admin?)
end
end
end
If you have Devise, you can check the permission directly from routes.rb :
# config/routes.rb
authenticate :user, -> (u) { u.admin? } do # Supposing there is a User#admin? method
mount ActiveAnalytics::Engine, at: "analytics" # http://localhost:3000/analytics
end
License
The gem is available as open-source under the terms of the MIT License.
Made by Base Secrète.
Rails developer? Check out RoRvsWild, our Ruby on Rails application monitoring tool.
*Note that all licence references and agreements mentioned in the ActiveAnalytics README section above
are relevant to that project's source code only.