1

I integrated ahoy well. But my purpose is to track how many times any model show page visited.

Let say i have 2 model CarModel and CarMake I want to tract visits like CarModel.first.visits and CarMake.first.visits

But only solutions find is to hit ahot.track("model"+car_model.id) and saves it in events and then I need to query by strings, which is not a generic way.

I want to get visits of any model by Model.visits is ahoy support like this?

Haseeb Ahmad
  • 7,914
  • 12
  • 55
  • 133
  • Isn't ahoy automatically tracking visits for you? And if you really want to use events, why don't you pass the `car_model.id` as an argument: `ahoy.track("car_model", { model: car_model.id })`? – jdno Nov 16 '18 at 10:50
  • Also check out this related question: https://stackoverflow.com/questions/4815713/simple-hit-counter-for-page-views-in-rails – jdno Nov 16 '18 at 10:54

0 Answers0