Class: Algolia::Insights::UserClient
- Inherits:
-
Object
- Object
- Algolia::Insights::UserClient
- Defined in:
- lib/algolia/insights_client.rb
Instance Method Summary collapse
-
#clicked_filters(event_name, index_name, filters, opts = {}) ⇒ Hash
Send a click event to capture the filters a user clicks on.
-
#clicked_object_ids(event_name, index_name, object_ids, opts = {}) ⇒ Hash
Send a click event to capture clicked items.
-
#clicked_object_ids_after_search(event_name, index_name, object_ids, positions, query_id, opts = {}) ⇒ Hash
Send a click event to capture a query and its clicked items and positions.
-
#converted_filters(event_name, index_name, filters, opts = {}) ⇒ Hash
Send a conversion event to capture the filters a user uses when converting.
-
#converted_object_ids(event_name, index_name, object_ids, opts = {}) ⇒ Hash
Send a conversion event to capture clicked items.
-
#converted_object_ids_after_search(event_name, index_name, object_ids, query_id, opts = {}) ⇒ Hash
Send a conversion event to capture a query and its clicked items.
-
#initialize(insights_client, user_token) ⇒ UserClient
constructor
Initializes the Insights userClient.
-
#viewed_filters(event_name, index_name, filters, opts = {}) ⇒ Hash
Send a view event to capture the filters a user uses when viewing.
-
#viewed_object_ids(event_name, index_name, object_ids, opts = {}) ⇒ Hash
Send a view event to capture clicked items.
Constructor Details
#initialize(insights_client, user_token) ⇒ UserClient
Initializes the Insights userClient
80 81 82 83 |
# File 'lib/algolia/insights_client.rb', line 80 def initialize(insights_client, user_token) @insights_client = insights_client @user_token = user_token end |
Instance Method Details
#clicked_filters(event_name, index_name, filters, opts = {}) ⇒ Hash
Send a click event to capture the filters a user clicks on.
134 135 136 137 138 139 140 141 142 |
# File 'lib/algolia/insights_client.rb', line 134 def clicked_filters(event_name, index_name, filters, opts = {}) @insights_client.send_event({ eventType: 'click', eventName: event_name, index: index_name, userToken: @user_token, filters: filters }, opts) end |
#clicked_object_ids(event_name, index_name, object_ids, opts = {}) ⇒ Hash
Send a click event to capture clicked items.
93 94 95 96 97 98 99 100 101 |
# File 'lib/algolia/insights_client.rb', line 93 def clicked_object_ids(event_name, index_name, object_ids, opts = {}) @insights_client.send_event({ eventType: 'click', eventName: event_name, index: index_name, userToken: @user_token, objectIds: object_ids }, opts) end |
#clicked_object_ids_after_search(event_name, index_name, object_ids, positions, query_id, opts = {}) ⇒ Hash
Send a click event to capture a query and its clicked items and positions.
113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/algolia/insights_client.rb', line 113 def clicked_object_ids_after_search(event_name, index_name, object_ids, positions, query_id, opts = {}) @insights_client.send_event({ eventType: 'click', eventName: event_name, index: index_name, userToken: @user_token, objectIds: object_ids, positions: positions, queryId: query_id }, opts) end |
#converted_filters(event_name, index_name, filters, opts = {}) ⇒ Hash
Send a conversion event to capture the filters a user uses when converting.
191 192 193 194 195 196 197 198 199 |
# File 'lib/algolia/insights_client.rb', line 191 def converted_filters(event_name, index_name, filters, opts = {}) @insights_client.send_event({ eventType: 'conversion', eventName: event_name, index: index_name, userToken: @user_token, filters: filters }, opts) end |
#converted_object_ids(event_name, index_name, object_ids, opts = {}) ⇒ Hash
Send a conversion event to capture clicked items.
152 153 154 155 156 157 158 159 160 |
# File 'lib/algolia/insights_client.rb', line 152 def converted_object_ids(event_name, index_name, object_ids, opts = {}) @insights_client.send_event({ eventType: 'conversion', eventName: event_name, index: index_name, userToken: @user_token, objectIds: object_ids }, opts) end |
#converted_object_ids_after_search(event_name, index_name, object_ids, query_id, opts = {}) ⇒ Hash
Send a conversion event to capture a query and its clicked items.
171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/algolia/insights_client.rb', line 171 def converted_object_ids_after_search(event_name, index_name, object_ids, query_id, opts = {}) @insights_client.send_event({ eventType: 'conversion', eventName: event_name, index: index_name, userToken: @user_token, objectIds: object_ids, queryId: query_id }, opts) end |
#viewed_filters(event_name, index_name, filters, opts = {}) ⇒ Hash
Send a view event to capture the filters a user uses when viewing.
227 228 229 230 231 232 233 234 235 |
# File 'lib/algolia/insights_client.rb', line 227 def viewed_filters(event_name, index_name, filters, opts = {}) @insights_client.send_event({ eventType: 'view', eventName: event_name, index: index_name, userToken: @user_token, filters: filters }, opts) end |
#viewed_object_ids(event_name, index_name, object_ids, opts = {}) ⇒ Hash
Send a view event to capture clicked items.
209 210 211 212 213 214 215 216 217 |
# File 'lib/algolia/insights_client.rb', line 209 def viewed_object_ids(event_name, index_name, object_ids, opts = {}) @insights_client.send_event({ eventType: 'view', eventName: event_name, index: index_name, userToken: @user_token, objectIds: object_ids }, opts) end |