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.25 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.24 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.23 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.22 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.21 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.20 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.19 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.18 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.17 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.16 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.15 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.14 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.13 app/controllers/workarea/storefront/analytics_controller.rb
workarea-storefront-3.4.12 app/controllers/workarea/storefront/analytics_controller.rb