A first-party analytics library for Rails that tracks visits and events directly in your database.
Ahoy is a first-party analytics library for Ruby on Rails applications that tracks website visits and custom events directly in your own database. It solves the problem of relying on external analytics services by giving developers full control and ownership of their analytics data, ensuring privacy and customization.
Rails developers who need to implement analytics within their applications without depending on third-party services, particularly those concerned with data privacy, GDPR compliance, and owning their data stack.
Developers choose Ahoy because it provides a simple, powerful, and privacy-focused alternative to commercial analytics tools, offering seamless integration with Rails, extensibility to custom data stores, and built-in features for GDPR compliance.
Simple, powerful, first-party analytics for Rails
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Ahoy stores all visits and events in your application's database by default, avoiding third-party data sharing and giving you full control over analytics data, as highlighted in the installation and philosophy sections.
It offers configurable options for IP masking, cookie-less anonymity sets, and data retention controls, making compliance straightforward with settings like 'Ahoy.mask_ips = true' in the GDPR section.
Supports tracking from Ruby controllers, JavaScript via Ahoy.js, and native iOS/Android apps with dedicated libraries, enabling consistent analytics across web and mobile platforms.
You can link visits to application models like orders using the 'visitable' method, allowing simple joins for attribution analysis without manual ID management.
While database-backed by default, Ahoy can be customized to use Kafka, RabbitMQ, or other backends via the data store API, providing flexibility for scaling as noted in the Data Stores section.
Enabling location tracking requires installing additional gems like Geocoder and MaxMindDB, plus configuring local databases or load balancers, adding complexity to initial setup.
Storing all raw events and visits in your database can lead to performance bottlenecks at scale, necessitating tools like Rollup for aggregation, which is admitted in the README's Rollups section.
Advanced analytics, forecasting, and anomaly detection require integrating separate gems like Prophet or AnomalyDetection.rb, increasing dependency management and setup effort.
GDPR-compliant features like IP masking and cookie-less tracking are opt-in, meaning developers must manually enable them, risking oversight if not carefully configured from the start.
Ahoy is an open-source alternative to the following products:
Mixpanel is an analytics platform that helps companies track user interactions with their digital products, providing insights into user behavior through event-based data collection.
A web analytics service that tracks and reports website traffic, providing insights into user behavior and marketing effectiveness.
Amplitude is a product analytics platform that helps companies understand user behavior, track product metrics, and make data-driven decisions to improve digital products.