Internal product analytics with Ahoy

06-Jun-2025 30
Learn how to use the Ahoy gem to track feature usage within your Ruby on Rails apps.Once you launch a new app or SaaS, one of the first questions you'll ask yourself is: "is anyone actually using my app?" Shortly followed by: "OK, we have some users.... but which features in my app are they using?" This article helps you answer the second question. By wiring the Ahoy gem into your Rails controllers, it's easy to track which actions your users take. (By the way, the Blazer gem is perfect for answering the first question). Why use Ahoy Ahoy is a simple, first-party analytics engine for Rails (and it's great!). You install the gem, initialize it, and use it to track visitors to your website. However, Ahoy also includes events, which is what we're interested in. Events map neatly onto specific actions a logged-in user takes within your app (for instance, Events integrate with Devise automatically to link to a specific user_id). We'll use Ahoy to automatically record Events in our controller actions, then use something like Blazer to query those events and answer questions like:.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle