- Integrate Ahoy gem for tracking user events and visits - Create models for Ahoy events and visits - Implement admin interfaces for managing events and visits - Add background job for cleaning up old analytics data - Update application controller and other relevant controllers to track specific actions This commit implements a comprehensive event tracking system that logs user interactions within the application. Additionally, it includes mechanisms for managing and cleaning historical visit and event data, ensuring efficient data handling.
20 lines
474 B
Ruby
20 lines
474 B
Ruby
class ApplicationController < ActionController::Base
|
|
include SeoConcern
|
|
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
|
|
allow_browser versions: :modern
|
|
before_action :set_locale
|
|
after_action :track_action
|
|
|
|
protected
|
|
|
|
def track_action
|
|
ahoy.track "Viewed Application", request.path_parameters
|
|
end
|
|
|
|
private
|
|
|
|
def set_locale
|
|
I18n.locale = params[:locale] || I18n.default_locale
|
|
end
|
|
end
|