Class: Workarea::Storefront::AnalyticsController

Inherits:
ActionController::Metal
  • Object
show all
Includes:
ActionController::Instrumentation
Defined in:
app/controllers/workarea/storefront/analytics_controller.rb

Instance Method Summary collapse

Instance Method Details

#category_viewObject



6
7
8
9
10
# File 'app/controllers/workarea/storefront/analytics_controller.rb', line 6

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

#filtersObject



31
32
33
34
35
36
# File 'app/controllers/workarea/storefront/analytics_controller.rb', line 31

def filters
warn "DEPRECATION WARNING: Filter analytics tracking is deprecated and will be removed \\\nin Workarea 3.5.\n"
end

#product_viewObject



12
13
14
15
16
# File 'app/controllers/workarea/storefront/analytics_controller.rb', line 12

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

#searchObject



18
19
20
21
22
# File 'app/controllers/workarea/storefront/analytics_controller.rb', line 18

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

#search_abandonmentObject



24
25
26
27
28
29
# File 'app/controllers/workarea/storefront/analytics_controller.rb', line 24

def search_abandonment
warn "DEPRECATION WARNING: Search abandonment tracking is deprecated and will be removed \\\nin Workarea 3.5.\n"
end