coltonmcbride1 said over 3 years ago on Tracking Events with Ahoy :
I've been able to get this to work just fine using devise which I use for admin access, but I'm also using a gem called otp-jwt for visitors to the site to access content and their actions are what I want to track, not devise users. I read the documentation and I'm confused on how to apply this to different sign in methods. For instance how do I apply this?

Custom User Method

Use a method besides current_user

Ahoy.user_method = :true_user
or use a proc

Ahoy.user_method = ->(controller) { controller.true_user }

Where do I put Ahoy.user_method = :true_user? I'm using current_subscriber instead of current_user. Do you have any experience with this? The documentation also says:

With other authentication frameworks, add this to the end of your sign in method:

ahoy.authenticate(user)

I'm not sure where I'm supposed to put this either


Login to Comment