Class: Workarea::Api::Storefront::AnalyticsController

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

Instance Method Summary collapse

Instance Method Details

#category_viewObject



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

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

#filtersObject



31
32
33
34
35
36
37
# File 'app/controllers/workarea/api/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  eos\n  head :ok\nend\n"

#product_viewObject



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

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

#searchObject



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

def search
  Metrics::SearchByDay.save_search(params[:q], params[:total_results])
  head :ok
end

#search_abandonmentObject



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

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