rubyrubygemsruby-on-rails-5ahoy

How to track additional post data using Ahoy gem?


I am using Ahoy gem to track article visits on my rails app. Ahoy save lot of visit data by default, for example landing_page url. Is there way to get and save to visits table additional post data, for example post title, which not comes by default?

Thanks!


Solution

  • Yes, there is a way to get and save whatever you want. Take a look at this: https://github.com/ankane/ahoy#events

    In the properties object you can specify any kind of data that you wish to track.