Class: Algolia::UserInsights

Inherits:
Object
  • Object
show all
Defined in:
lib/algolia/insights.rb

Instance Method Summary collapse

Constructor Details

#initialize(insights, user_token) ⇒ UserInsights

Returns a new instance of UserInsights.



55
56
57
58
# File 'lib/algolia/insights.rb', line 55

def initialize(insights, user_token)
  @insights = insights
  @user_token = user_token
end

Instance Method Details

#clicked_filters(event_name, index_name, filters, request_options = {}) ⇒ Object



72
73
74
# File 'lib/algolia/insights.rb', line 72

def clicked_filters(event_name, index_name, filters, request_options = {})
  clicked({ 'filters' => filters }, event_name, index_name, request_options)
end

#clicked_object_ids(event_name, index_name, object_ids, request_options = {}) ⇒ Object



60
61
62
# File 'lib/algolia/insights.rb', line 60

def clicked_object_ids(event_name, index_name, object_ids, request_options = {})
  clicked({ 'objectIDs' => object_ids }, event_name, index_name, request_options)
end

#clicked_object_ids_after_search(event_name, index_name, object_ids, positions, query_id, request_options = {}) ⇒ Object



64
65
66
67
68
69
70
# File 'lib/algolia/insights.rb', line 64

def clicked_object_ids_after_search(event_name, index_name, object_ids, positions, query_id, request_options = {})
  clicked({
              'objectIDs' => object_ids,
              'positions' => positions,
              'queryID' => query_id,
          }, event_name, index_name, request_options)
end

#converted_filters(event_name, index_name, filters, request_options = {}) ⇒ Object



87
88
89
# File 'lib/algolia/insights.rb', line 87

def converted_filters(event_name, index_name, filters, request_options = {})
  converted({ 'filters' => filters }, event_name, index_name, request_options)
end

#converted_object_ids(event_name, index_name, object_ids, request_options = {}) ⇒ Object



76
77
78
# File 'lib/algolia/insights.rb', line 76

def converted_object_ids(event_name, index_name, object_ids, request_options = {})
  converted({ 'objectIDs' => object_ids }, event_name, index_name, request_options)
end

#converted_object_ids_after_search(event_name, index_name, object_ids, query_id, request_options = {}) ⇒ Object



80
81
82
83
84
85
# File 'lib/algolia/insights.rb', line 80

def converted_object_ids_after_search(event_name, index_name, object_ids, query_id, request_options = {})
  converted({
              'objectIDs' => object_ids,
              'queryID' => query_id,
          }, event_name, index_name, request_options)
end

#viewed_filters(event_name, index_name, filters, request_options = {}) ⇒ Object



95
96
97
# File 'lib/algolia/insights.rb', line 95

def viewed_filters(event_name, index_name, filters, request_options = {})
  viewed({ 'filters' => filters }, event_name, index_name, request_options)
end

#viewed_object_ids(event_name, index_name, object_ids, request_options = {}) ⇒ Object



91
92
93
# File 'lib/algolia/insights.rb', line 91

def viewed_object_ids(event_name, index_name, object_ids, request_options = {})
  viewed({ 'objectIDs' => object_ids }, event_name, index_name, request_options)
end