Im setting up Ahoy gem
into my application, but there are some options that I don't understand where to add.
This is what I have done currently:
1) Added gem "ahoy_matey"
to my Gem File and ran Bundle install
& restarted my server
2) Added //= require jquery
& //= require ahoy
to my application.js
3) Ran rails generate ahoy:stores:active_record
and added new tables to my database by running rake db:migrate
I also have ahoy.rb
in my initializers folder.
At this point I can see that ahoy
is added in my application, but not sure how to do some stuff.
I want to add Ahoy.cookie_domain = :all
& Ahoy.visit_duration = 1.minute
, But I don't know where to add them
AND one other issue I have is that whatever page I go to is added to my Visits
table (PS: I haven't added any JS
or Ruby
code for tracking in any pages or controller) and as I see it ,ahoy gem
tracks all events/visits in my application. I only want to track events/visits on one particular action in my whole application, posts#show
action and rest don't need to be added at all.
How can I achieve this?