Search code examples
ruby-on-railsrubyanalyticsahoy

ahoy events Post error in rails


I started code rails recently and I need to figure out this problem.

I use this function especially for my project. So i customize name and properties variables.

ahoy.track(name, properties);

In local there is no problem but in the live version when the tracking method runs i received 404 error. This line create A POST request to /ahoy/events and there is no path /ahoy/events in the live version.


Solution

  • Hi everyone i try a lot and finally i found solution. Meanwhile this issue helped me a lot.

    I modify only two files in my project.

    ahoy.rb

      mattr_accessor :auto_mount
      self.auto_mount = false
    

    routes.rb

    mount Ahoy::Engine => "/ahoy", as: :my_ahoy