Sha256: f04ea5cbc9cb6267376a2b020c008f4779b47b62c16b97d76b01ba019d28e4ab

Contents?: true

Size: 1.01 KB

Versions: 34

Compression:

Stored size: 1.01 KB

Contents

module Workarea
  module Storefront
    class AnalyticsController < ActionController::Metal
      include ActionController::Instrumentation

      def category_view
        unless robot?
          Metrics::CategoryByDay.inc(key: { category_id: params[:category_id] }, views: 1)
        end
      end

      def product_view
        unless robot?
          Metrics::ProductByDay.inc(key: { product_id: params[:product_id] }, views: 1)
        end
      end

      def search
        unless robot?
          Metrics::SearchByDay.save_search(params[:q], params[:total_results])
        end
      end

      def search_abandonment
      warn <<~eos
DEPRECATION WARNING: Search abandonment tracking is deprecated and will be removed \
in Workarea 3.5.
      eos
      end

      def filters
      warn <<~eos
DEPRECATION WARNING: Filter analytics tracking is deprecated and will be removed \
in Workarea 3.5.
      eos
      end

      private

      def robot?
        Robots.is_robot?(request.user_agent)
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-storefront-3.4.45 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.44 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.43 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.42 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.41 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.40 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.39 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.38 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.37 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.36 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.35 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.34 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.33 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.32 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.31 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.30 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.29 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.28 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.27 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.26 app/controllers/workarea/storefront/analytics_controller.rb