Class: Algolia::AnalyticsClient
- Inherits:
-
Object
- Object
- Algolia::AnalyticsClient
- Defined in:
- lib/algolia/api/analytics_client.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Class Method Summary collapse
Instance Method Summary collapse
- #custom_delete(path, parameters = nil, request_options = {}) ⇒ Object
-
#custom_delete_with_http_info(path, parameters = nil, request_options = {}) ⇒ Http::Response
The response.
- #custom_get(path, parameters = nil, request_options = {}) ⇒ Object
-
#custom_get_with_http_info(path, parameters = nil, request_options = {}) ⇒ Http::Response
The response.
- #custom_post(path, parameters = nil, body = nil, request_options = {}) ⇒ Object
-
#custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {}) ⇒ Http::Response
The response.
- #custom_put(path, parameters = nil, body = nil, request_options = {}) ⇒ Object
-
#custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {}) ⇒ Http::Response
The response.
-
#get_add_to_cart_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetAddToCartRateResponse
Retrieves the add-to-cart rate for all of your searches with at least one add-to-cart event, including a daily breakdown.
-
#get_add_to_cart_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the add-to-cart rate for all of your searches with at least one add-to-cart event, including a daily breakdown.
-
#get_average_click_position(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetAverageClickPositionResponse
Retrieves the average click position of your search results, including a daily breakdown.
-
#get_average_click_position_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the average click position of your search results, including a daily breakdown.
-
#get_click_positions(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetClickPositionsResponse
Retrieves the positions in the search results and their associated number of clicks.
-
#get_click_positions_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the positions in the search results and their associated number of clicks.
-
#get_click_through_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetClickThroughRateResponse
Retrieves the click-through rate for all of your searches with at least one click event, including a daily breakdown By default, the analyzed period includes the last eight days including the current day.
-
#get_click_through_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the click-through rate for all of your searches with at least one click event, including a daily breakdown By default, the analyzed period includes the last eight days including the current day.
-
#get_conversion_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetConversionRateResponse
Retrieves the conversion rate for all of your searches with at least one conversion event, including a daily breakdown.
-
#get_conversion_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the conversion rate for all of your searches with at least one conversion event, including a daily breakdown.
-
#get_no_click_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetNoClickRateResponse
Retrieves the fraction of searches that didn’t lead to any click within a time range, including a daily breakdown.
-
#get_no_click_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the fraction of searches that didn't lead to any click within a time range, including a daily breakdown.
-
#get_no_results_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetNoResultsRateResponse
Retrieves the fraction of searches that didn’t return any results within a time range, including a daily breakdown.
-
#get_no_results_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the fraction of searches that didn't return any results within a time range, including a daily breakdown.
-
#get_purchase_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetPurchaseRateResponse
Retrieves the purchase rate for all of your searches with at least one purchase event, including a daily breakdown.
-
#get_purchase_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the purchase rate for all of your searches with at least one purchase event, including a daily breakdown.
-
#get_revenue(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetRevenue
Retrieves revenue-related metrics, such as the total revenue or the average order value.
-
#get_revenue_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves revenue-related metrics, such as the total revenue or the average order value.
-
#get_searches_count(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetSearchesCountResponse
Retrieves the number of searches within a time range, including a daily breakdown.
-
#get_searches_count_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the number of searches within a time range, including a daily breakdown.
-
#get_searches_no_clicks(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetSearchesNoClicksResponse
Retrieves the most popular searches that didn’t lead to any clicks, from the 1,000 most frequent searches.
-
#get_searches_no_clicks_with_http_info(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the most popular searches that didn't lead to any clicks, from the 1,000 most frequent searches.
-
#get_searches_no_results(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetSearchesNoResultsResponse
Retrieves the most popular searches that didn’t return any results.
-
#get_searches_no_results_with_http_info(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the most popular searches that didn't return any results.
-
#get_status(index, request_options = {}) ⇒ GetStatusResponse
Retrieves the time when the Analytics data for the specified index was last updated.
-
#get_status_with_http_info(index, request_options = {}) ⇒ Http::Response
Retrieves the time when the Analytics data for the specified index was last updated.
-
#get_top_countries(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetTopCountriesResponse
Retrieves the countries with the most searches to your index.
-
#get_top_countries_with_http_info(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the countries with the most searches to your index.
-
#get_top_filter_attributes(index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetTopFilterAttributesResponse
Retrieves the most frequently used filter attributes.
-
#get_top_filter_attributes_with_http_info(index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the most frequently used filter attributes.
-
#get_top_filter_for_attribute(attribute, index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetTopFilterForAttributeResponse
Retrieves the most frequent filter (facet) values for a filter attribute.
-
#get_top_filter_for_attribute_with_http_info(attribute, index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the most frequent filter (facet) values for a filter attribute.
-
#get_top_filters_no_results(index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetTopFiltersNoResultsResponse
Retrieves the most frequently used filters for a search that didn’t return any results.
-
#get_top_filters_no_results_with_http_info(index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the most frequently used filters for a search that didn't return any results.
-
#get_top_hits(index, search = nil, click_analytics = nil, revenue_analytics = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetTopHitsResponse
Retrieves the object IDs of the most frequent search results.
-
#get_top_hits_with_http_info(index, search = nil, click_analytics = nil, revenue_analytics = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the object IDs of the most frequent search results.
-
#get_top_searches(index, click_analytics = nil, revenue_analytics = nil, start_date = nil, end_date = nil, order_by = nil, direction = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetTopSearchesResponse
Returns the most popular search terms.
-
#get_top_searches_with_http_info(index, click_analytics = nil, revenue_analytics = nil, start_date = nil, end_date = nil, order_by = nil, direction = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Returns the most popular search terms.
-
#get_users_count(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetUsersCountResponse
Retrieves the number of unique users within a time range, including a daily breakdown.
-
#get_users_count_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the number of unique users within a time range, including a daily breakdown.
-
#initialize(config = nil) ⇒ AnalyticsClient
constructor
A new instance of AnalyticsClient.
-
#set_client_api_key(api_key) ⇒ void
Helper method to switch the API key used to authenticate the requests.
Constructor Details
#initialize(config = nil) ⇒ AnalyticsClient
Returns a new instance of AnalyticsClient.
7 8 9 10 11 12 13 |
# File 'lib/algolia/api/analytics_client.rb', line 7 def initialize(config = nil) raise "`config` is missing." if config.nil? raise "`app_id` is missing." if config.app_id.nil? || config.app_id == "" raise "`api_key` is missing." if config.api_key.nil? || config.api_key == "" @api_client = Algolia::ApiClient.new(config) end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
5 6 7 |
# File 'lib/algolia/api/analytics_client.rb', line 5 def api_client @api_client end |
Class Method Details
.create(app_id, api_key, region = nil, opts = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/algolia/api/analytics_client.rb', line 15 def self.create(app_id, api_key, region = nil, opts = {}) hosts = [] regions = ["de", "us"] if region.is_a?(Hash) && (opts.nil? || opts.empty?) opts = region region = nil end if !region.nil? && (!region.is_a?(String) || !regions.include?(region)) raise "`region` must be one of the following: #{regions.join(", ")}" end hosts << Transport::StatefulHost.new( region.nil? ? "analytics.algolia.com" : "analytics.{region}.algolia.com".sub!("{region}", region), accept: CallType::READ | CallType::WRITE ) config = Algolia::Configuration.new(app_id, api_key, hosts, "Analytics", opts) create_with_config(config) end |
.create_with_config(config) ⇒ Object
38 39 40 |
# File 'lib/algolia/api/analytics_client.rb', line 38 def self.create_with_config(config) new(config) end |
Instance Method Details
#custom_delete(path, parameters = nil, request_options = {}) ⇒ Object
88 89 90 91 |
# File 'lib/algolia/api/analytics_client.rb', line 88 def custom_delete(path, parameters = nil, = {}) response = custom_delete_with_http_info(path, parameters, ) @api_client.deserialize(response.body, [:debug_return_type] || "Object") end |
#custom_delete_with_http_info(path, parameters = nil, request_options = {}) ⇒ Http::Response
Returns the response.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/algolia/api/analytics_client.rb', line 56 def custom_delete_with_http_info(path, parameters = nil, = {}) # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? raise ArgumentError, "Parameter `path` is required when calling `custom_delete`." end path = "/{path}".sub("{" + "path" + "}", path.to_s) query_params = {} query_params = query_params.merge(parameters) unless parameters.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.custom_delete", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:DELETE, path, ) end |
#custom_get(path, parameters = nil, request_options = {}) ⇒ Object
131 132 133 134 |
# File 'lib/algolia/api/analytics_client.rb', line 131 def custom_get(path, parameters = nil, = {}) response = custom_get_with_http_info(path, parameters, ) @api_client.deserialize(response.body, [:debug_return_type] || "Object") end |
#custom_get_with_http_info(path, parameters = nil, request_options = {}) ⇒ Http::Response
Returns the response.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/algolia/api/analytics_client.rb', line 99 def custom_get_with_http_info(path, parameters = nil, = {}) # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? raise ArgumentError, "Parameter `path` is required when calling `custom_get`." end path = "/{path}".sub("{" + "path" + "}", path.to_s) query_params = {} query_params = query_params.merge(parameters) unless parameters.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.custom_get", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#custom_post(path, parameters = nil, body = nil, request_options = {}) ⇒ Object
176 177 178 179 |
# File 'lib/algolia/api/analytics_client.rb', line 176 def custom_post(path, parameters = nil, body = nil, = {}) response = custom_post_with_http_info(path, parameters, body, ) @api_client.deserialize(response.body, [:debug_return_type] || "Object") end |
#custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {}) ⇒ Http::Response
Returns the response.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/algolia/api/analytics_client.rb', line 143 def custom_post_with_http_info(path, parameters = nil, body = nil, = {}) # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? raise ArgumentError, "Parameter `path` is required when calling `custom_post`." end path = "/{path}".sub("{" + "path" + "}", path.to_s) query_params = {} query_params = query_params.merge(parameters) unless parameters.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(body) = .merge( :operation => :"AnalyticsClient.custom_post", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:POST, path, ) end |
#custom_put(path, parameters = nil, body = nil, request_options = {}) ⇒ Object
221 222 223 224 |
# File 'lib/algolia/api/analytics_client.rb', line 221 def custom_put(path, parameters = nil, body = nil, = {}) response = custom_put_with_http_info(path, parameters, body, ) @api_client.deserialize(response.body, [:debug_return_type] || "Object") end |
#custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {}) ⇒ Http::Response
Returns the response.
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/algolia/api/analytics_client.rb', line 188 def custom_put_with_http_info(path, parameters = nil, body = nil, = {}) # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? raise ArgumentError, "Parameter `path` is required when calling `custom_put`." end path = "/{path}".sub("{" + "path" + "}", path.to_s) query_params = {} query_params = query_params.merge(parameters) unless parameters.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(body) = .merge( :operation => :"AnalyticsClient.custom_put", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:PUT, path, ) end |
#get_add_to_cart_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetAddToCartRateResponse
Retrieves the add-to-cart rate for all of your searches with at least one add-to-cart event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
275 276 277 278 279 280 281 |
# File 'lib/algolia/api/analytics_client.rb', line 275 def get_add_to_cart_rate(index, start_date = nil, end_date = nil, = nil, = {}) response = get_add_to_cart_rate_with_http_info(index, start_date, end_date, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetAddToCartRateResponse" ) end |
#get_add_to_cart_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the add-to-cart rate for all of your searches with at least one add-to-cart event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/algolia/api/analytics_client.rb', line 236 def get_add_to_cart_rate_with_http_info(index, start_date = nil, end_date = nil, = nil, = {}) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_add_to_cart_rate`." end path = "/2/conversions/addToCartRate" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_add_to_cart_rate", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_average_click_position(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetAverageClickPositionResponse
Retrieves the average click position of your search results, including a daily breakdown. The average click position is the average of all clicked search results’ positions. For example, if users only ever click on the first result for any search, the average click position is 1. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
338 339 340 341 342 343 344 |
# File 'lib/algolia/api/analytics_client.rb', line 338 def get_average_click_position(index, start_date = nil, end_date = nil, = nil, = {}) response = get_average_click_position_with_http_info(index, start_date, end_date, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetAverageClickPositionResponse" ) end |
#get_average_click_position_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the average click position of your search results, including a daily breakdown. The average click position is the average of all clicked search results' positions. For example, if users only ever click on the first result for any search, the average click position is 1. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 |
# File 'lib/algolia/api/analytics_client.rb', line 293 def get_average_click_position_with_http_info( index, start_date = nil, end_date = nil, = nil, = {} ) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_average_click_position`." end path = "/2/clicks/averageClickPosition" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_average_click_position", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_click_positions(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetClickPositionsResponse
Retrieves the positions in the search results and their associated number of clicks. This lets you check how many clicks the first, second, or tenth search results receive.
Required API Key ACLs:
- analytics
395 396 397 398 399 400 401 |
# File 'lib/algolia/api/analytics_client.rb', line 395 def get_click_positions(index, start_date = nil, end_date = nil, = nil, = {}) response = get_click_positions_with_http_info(index, start_date, end_date, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetClickPositionsResponse" ) end |
#get_click_positions_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the positions in the search results and their associated number of clicks. This lets you check how many clicks the first, second, or tenth search results receive.
Required API Key ACLs:
- analytics
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/algolia/api/analytics_client.rb', line 356 def get_click_positions_with_http_info(index, start_date = nil, end_date = nil, = nil, = {}) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_click_positions`." end path = "/2/clicks/positions" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_click_positions", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_click_through_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetClickThroughRateResponse
Retrieves the click-through rate for all of your searches with at least one click event, including a daily breakdown By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
452 453 454 455 456 457 458 |
# File 'lib/algolia/api/analytics_client.rb', line 452 def get_click_through_rate(index, start_date = nil, end_date = nil, = nil, = {}) response = get_click_through_rate_with_http_info(index, start_date, end_date, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetClickThroughRateResponse" ) end |
#get_click_through_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the click-through rate for all of your searches with at least one click event, including a daily breakdown By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 |
# File 'lib/algolia/api/analytics_client.rb', line 413 def get_click_through_rate_with_http_info(index, start_date = nil, end_date = nil, = nil, = {}) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_click_through_rate`." end path = "/2/clicks/clickThroughRate" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_click_through_rate", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_conversion_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetConversionRateResponse
Retrieves the conversion rate for all of your searches with at least one conversion event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
509 510 511 512 513 514 515 |
# File 'lib/algolia/api/analytics_client.rb', line 509 def get_conversion_rate(index, start_date = nil, end_date = nil, = nil, = {}) response = get_conversion_rate_with_http_info(index, start_date, end_date, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetConversionRateResponse" ) end |
#get_conversion_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the conversion rate for all of your searches with at least one conversion event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 |
# File 'lib/algolia/api/analytics_client.rb', line 470 def get_conversion_rate_with_http_info(index, start_date = nil, end_date = nil, = nil, = {}) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_conversion_rate`." end path = "/2/conversions/conversionRate" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_conversion_rate", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_no_click_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetNoClickRateResponse
Retrieves the fraction of searches that didn’t lead to any click within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
566 567 568 569 |
# File 'lib/algolia/api/analytics_client.rb', line 566 def get_no_click_rate(index, start_date = nil, end_date = nil, = nil, = {}) response = get_no_click_rate_with_http_info(index, start_date, end_date, , ) @api_client.deserialize(response.body, [:debug_return_type] || "Analytics::GetNoClickRateResponse") end |
#get_no_click_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the fraction of searches that didn't lead to any click within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 |
# File 'lib/algolia/api/analytics_client.rb', line 527 def get_no_click_rate_with_http_info(index, start_date = nil, end_date = nil, = nil, = {}) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_no_click_rate`." end path = "/2/searches/noClickRate" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_no_click_rate", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_no_results_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetNoResultsRateResponse
Retrieves the fraction of searches that didn’t return any results within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
620 621 622 623 624 625 626 |
# File 'lib/algolia/api/analytics_client.rb', line 620 def get_no_results_rate(index, start_date = nil, end_date = nil, = nil, = {}) response = get_no_results_rate_with_http_info(index, start_date, end_date, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetNoResultsRateResponse" ) end |
#get_no_results_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the fraction of searches that didn't return any results within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 |
# File 'lib/algolia/api/analytics_client.rb', line 581 def get_no_results_rate_with_http_info(index, start_date = nil, end_date = nil, = nil, = {}) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_no_results_rate`." end path = "/2/searches/noResultRate" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_no_results_rate", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_purchase_rate(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetPurchaseRateResponse
Retrieves the purchase rate for all of your searches with at least one purchase event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
677 678 679 680 681 682 683 |
# File 'lib/algolia/api/analytics_client.rb', line 677 def get_purchase_rate(index, start_date = nil, end_date = nil, = nil, = {}) response = get_purchase_rate_with_http_info(index, start_date, end_date, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetPurchaseRateResponse" ) end |
#get_purchase_rate_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the purchase rate for all of your searches with at least one purchase event, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 |
# File 'lib/algolia/api/analytics_client.rb', line 638 def get_purchase_rate_with_http_info(index, start_date = nil, end_date = nil, = nil, = {}) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_purchase_rate`." end path = "/2/conversions/purchaseRate" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_purchase_rate", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_revenue(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetRevenue
Retrieves revenue-related metrics, such as the total revenue or the average order value. To retrieve revenue-related metrics, sent purchase events. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
734 735 736 737 |
# File 'lib/algolia/api/analytics_client.rb', line 734 def get_revenue(index, start_date = nil, end_date = nil, = nil, = {}) response = get_revenue_with_http_info(index, start_date, end_date, , ) @api_client.deserialize(response.body, [:debug_return_type] || "Analytics::GetRevenue") end |
#get_revenue_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves revenue-related metrics, such as the total revenue or the average order value. To retrieve revenue-related metrics, sent purchase events. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 |
# File 'lib/algolia/api/analytics_client.rb', line 695 def get_revenue_with_http_info(index, start_date = nil, end_date = nil, = nil, = {}) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_revenue`." end path = "/2/conversions/revenue" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_revenue", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_searches_count(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetSearchesCountResponse
Retrieves the number of searches within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
788 789 790 791 792 793 794 |
# File 'lib/algolia/api/analytics_client.rb', line 788 def get_searches_count(index, start_date = nil, end_date = nil, = nil, = {}) response = get_searches_count_with_http_info(index, start_date, end_date, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetSearchesCountResponse" ) end |
#get_searches_count_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the number of searches within a time range, including a daily breakdown. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 |
# File 'lib/algolia/api/analytics_client.rb', line 749 def get_searches_count_with_http_info(index, start_date = nil, end_date = nil, = nil, = {}) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_searches_count`." end path = "/2/searches/count" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_searches_count", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_searches_no_clicks(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetSearchesNoClicksResponse
Retrieves the most popular searches that didn’t lead to any clicks, from the 1,000 most frequent searches.
Required API Key ACLs:
- analytics
859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 |
# File 'lib/algolia/api/analytics_client.rb', line 859 def get_searches_no_clicks( index, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) response = get_searches_no_clicks_with_http_info( index, start_date, end_date, limit, offset, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetSearchesNoClicksResponse" ) end |
#get_searches_no_clicks_with_http_info(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the most popular searches that didn't lead to any clicks, from the 1,000 most frequent searches.
Required API Key ACLs:
- analytics
808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 |
# File 'lib/algolia/api/analytics_client.rb', line 808 def get_searches_no_clicks_with_http_info( index, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_searches_no_clicks`." end path = "/2/searches/noClicks" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:limit] = limit unless limit.nil? query_params[:offset] = offset unless offset.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_searches_no_clicks", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_searches_no_results(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetSearchesNoResultsResponse
Retrieves the most popular searches that didn’t return any results.
Required API Key ACLs:
- analytics
946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 |
# File 'lib/algolia/api/analytics_client.rb', line 946 def get_searches_no_results( index, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) response = get_searches_no_results_with_http_info( index, start_date, end_date, limit, offset, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetSearchesNoResultsResponse" ) end |
#get_searches_no_results_with_http_info(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the most popular searches that didn't return any results.
Required API Key ACLs:
- analytics
895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 |
# File 'lib/algolia/api/analytics_client.rb', line 895 def get_searches_no_results_with_http_info( index, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_searches_no_results`." end path = "/2/searches/noResults" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:limit] = limit unless limit.nil? query_params[:offset] = offset unless offset.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_searches_no_results", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_status(index, request_options = {}) ⇒ GetStatusResponse
Retrieves the time when the Analytics data for the specified index was last updated. The Analytics data is updated every 5 minutes.
Required API Key ACLs:
- analytics
1010 1011 1012 1013 |
# File 'lib/algolia/api/analytics_client.rb', line 1010 def get_status(index, = {}) response = get_status_with_http_info(index, ) @api_client.deserialize(response.body, [:debug_return_type] || "Analytics::GetStatusResponse") end |
#get_status_with_http_info(index, request_options = {}) ⇒ Http::Response
Retrieves the time when the Analytics data for the specified index was last updated. The Analytics data is updated every 5 minutes.
Required API Key ACLs:
- analytics
977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 |
# File 'lib/algolia/api/analytics_client.rb', line 977 def get_status_with_http_info(index, = {}) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_status`." end path = "/2/status" query_params = {} query_params[:index] = index query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_status", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_top_countries(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetTopCountriesResponse
Retrieves the countries with the most searches to your index.
Required API Key ACLs:
- analytics
1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 |
# File 'lib/algolia/api/analytics_client.rb', line 1078 def get_top_countries( index, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) response = get_top_countries_with_http_info(index, start_date, end_date, limit, offset, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetTopCountriesResponse" ) end |
#get_top_countries_with_http_info(index, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the countries with the most searches to your index.
Required API Key ACLs:
- analytics
1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 |
# File 'lib/algolia/api/analytics_client.rb', line 1027 def get_top_countries_with_http_info( index, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_top_countries`." end path = "/2/countries" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:limit] = limit unless limit.nil? query_params[:offset] = offset unless offset.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_top_countries", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_top_filter_attributes(index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetTopFilterAttributesResponse
Retrieves the most frequently used filter attributes. These are attributes of your records that you included in the ‘attributesForFaceting` setting.
Required API Key ACLs:
- analytics
1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 |
# File 'lib/algolia/api/analytics_client.rb', line 1161 def get_top_filter_attributes( index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) response = get_top_filter_attributes_with_http_info( index, search, start_date, end_date, limit, offset, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetTopFilterAttributesResponse" ) end |
#get_top_filter_attributes_with_http_info(index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the most frequently used filter attributes. These are attributes of your records that you included in the `attributesForFaceting` setting.
Required API Key ACLs:
- analytics
1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 |
# File 'lib/algolia/api/analytics_client.rb', line 1107 def get_top_filter_attributes_with_http_info( index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_top_filter_attributes`." end path = "/2/filters" query_params = {} query_params[:index] = index query_params[:search] = search unless search.nil? query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:limit] = limit unless limit.nil? query_params[:offset] = offset unless offset.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_top_filter_attributes", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_top_filter_for_attribute(attribute, index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetTopFilterForAttributeResponse
Retrieves the most frequent filter (facet) values for a filter attribute. These are attributes of your records that you included in the ‘attributesForFaceting` setting.
Required API Key ACLs:
- analytics
1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 |
# File 'lib/algolia/api/analytics_client.rb', line 1261 def get_top_filter_for_attribute( attribute, index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) response = get_top_filter_for_attribute_with_http_info( attribute, index, search, start_date, end_date, limit, offset, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetTopFilterForAttributeResponse" ) end |
#get_top_filter_for_attribute_with_http_info(attribute, index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the most frequent filter (facet) values for a filter attribute. These are attributes of your records that you included in the `attributesForFaceting` setting.
Required API Key ACLs:
- analytics
1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 |
# File 'lib/algolia/api/analytics_client.rb', line 1201 def get_top_filter_for_attribute_with_http_info( attribute, index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) # verify the required parameter 'attribute' is set if @api_client.config.client_side_validation && attribute.nil? raise ArgumentError, "Parameter `attribute` is required when calling `get_top_filter_for_attribute`." end # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_top_filter_for_attribute`." end path = "/2/filters/{attribute}".sub("{" + "attribute" + "}", Transport.encode_uri(attribute.to_s)) query_params = {} query_params[:index] = index query_params[:search] = search unless search.nil? query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:limit] = limit unless limit.nil? query_params[:offset] = offset unless offset.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_top_filter_for_attribute", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_top_filters_no_results(index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetTopFiltersNoResultsResponse
Retrieves the most frequently used filters for a search that didn’t return any results. To get the most frequent searches without results, use the [Retrieve searches without results](#tag/search/operation/getSearchesNoResults) operation.
Required API Key ACLs:
- analytics
1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 |
# File 'lib/algolia/api/analytics_client.rb', line 1356 def get_top_filters_no_results( index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) response = get_top_filters_no_results_with_http_info( index, search, start_date, end_date, limit, offset, , ) @api_client.deserialize( response.body, [:debug_return_type] || "Analytics::GetTopFiltersNoResultsResponse" ) end |
#get_top_filters_no_results_with_http_info(index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the most frequently used filters for a search that didn't return any results. To get the most frequent searches without results, use the [Retrieve searches without results](#tag/search/operation/getSearchesNoResults) operation.
Required API Key ACLs:
- analytics
1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 |
# File 'lib/algolia/api/analytics_client.rb', line 1302 def get_top_filters_no_results_with_http_info( index, search = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_top_filters_no_results`." end path = "/2/filters/noResults" query_params = {} query_params[:index] = index query_params[:search] = search unless search.nil? query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:limit] = limit unless limit.nil? query_params[:offset] = offset unless offset.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_top_filters_no_results", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_top_hits(index, search = nil, click_analytics = nil, revenue_analytics = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetTopHitsResponse
Retrieves the object IDs of the most frequent search results.
Required API Key ACLs:
- analytics
1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 |
# File 'lib/algolia/api/analytics_client.rb', line 1457 def get_top_hits( index, search = nil, click_analytics = nil, revenue_analytics = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) response = get_top_hits_with_http_info( index, search, click_analytics, revenue_analytics, start_date, end_date, limit, offset, , ) @api_client.deserialize(response.body, [:debug_return_type] || "Analytics::GetTopHitsResponse") end |
#get_top_hits_with_http_info(index, search = nil, click_analytics = nil, revenue_analytics = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the object IDs of the most frequent search results.
Required API Key ACLs:
- analytics
1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 |
# File 'lib/algolia/api/analytics_client.rb', line 1397 def get_top_hits_with_http_info( index, search = nil, click_analytics = nil, revenue_analytics = nil, start_date = nil, end_date = nil, limit = nil, offset = nil, = nil, = {} ) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_top_hits`." end path = "/2/hits" query_params = {} query_params[:index] = index query_params[:search] = search unless search.nil? query_params[:clickAnalytics] = click_analytics unless click_analytics.nil? query_params[:revenueAnalytics] = revenue_analytics unless revenue_analytics.nil? query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:limit] = limit unless limit.nil? query_params[:offset] = offset unless offset.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_top_hits", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_top_searches(index, click_analytics = nil, revenue_analytics = nil, start_date = nil, end_date = nil, order_by = nil, direction = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ GetTopSearchesResponse
Returns the most popular search terms.
Required API Key ACLs:
- analytics
1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 |
# File 'lib/algolia/api/analytics_client.rb', line 1563 def get_top_searches( index, click_analytics = nil, revenue_analytics = nil, start_date = nil, end_date = nil, order_by = nil, direction = nil, limit = nil, offset = nil, = nil, = {} ) response = get_top_searches_with_http_info( index, click_analytics, revenue_analytics, start_date, end_date, order_by, direction, limit, offset, , ) @api_client.deserialize(response.body, [:debug_return_type] || "Analytics::GetTopSearchesResponse") end |
#get_top_searches_with_http_info(index, click_analytics = nil, revenue_analytics = nil, start_date = nil, end_date = nil, order_by = nil, direction = nil, limit = nil, offset = nil, tags = nil, request_options = {}) ⇒ Http::Response
Returns the most popular search terms.
Required API Key ACLs:
- analytics
1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 |
# File 'lib/algolia/api/analytics_client.rb', line 1500 def get_top_searches_with_http_info( index, click_analytics = nil, revenue_analytics = nil, start_date = nil, end_date = nil, order_by = nil, direction = nil, limit = nil, offset = nil, = nil, = {} ) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_top_searches`." end path = "/2/searches" query_params = {} query_params[:index] = index query_params[:clickAnalytics] = click_analytics unless click_analytics.nil? query_params[:revenueAnalytics] = revenue_analytics unless revenue_analytics.nil? query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:orderBy] = order_by unless order_by.nil? query_params[:direction] = direction unless direction.nil? query_params[:limit] = limit unless limit.nil? query_params[:offset] = offset unless offset.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_top_searches", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_users_count(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ GetUsersCountResponse
Retrieves the number of unique users within a time range, including a daily breakdown. Since this endpoint returns the number of unique users, the sum of the daily values might be different from the total number. By default, Algolia distinguishes search users by their IP address, unless you include a pseudonymous user identifier in your search requests with the ‘userToken` API parameter or `x-algolia-usertoken` request header. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
1641 1642 1643 1644 |
# File 'lib/algolia/api/analytics_client.rb', line 1641 def get_users_count(index, start_date = nil, end_date = nil, = nil, = {}) response = get_users_count_with_http_info(index, start_date, end_date, , ) @api_client.deserialize(response.body, [:debug_return_type] || "Analytics::GetUsersCountResponse") end |
#get_users_count_with_http_info(index, start_date = nil, end_date = nil, tags = nil, request_options = {}) ⇒ Http::Response
Retrieves the number of unique users within a time range, including a daily breakdown. Since this endpoint returns the number of unique users, the sum of the daily values might be different from the total number. By default, Algolia distinguishes search users by their IP address, unless you include a pseudonymous user identifier in your search requests with the `userToken` API parameter or `x-algolia-usertoken` request header. By default, the analyzed period includes the last eight days including the current day.
Required API Key ACLs:
- analytics
1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 |
# File 'lib/algolia/api/analytics_client.rb', line 1602 def get_users_count_with_http_info(index, start_date = nil, end_date = nil, = nil, = {}) # verify the required parameter 'index' is set if @api_client.config.client_side_validation && index.nil? raise ArgumentError, "Parameter `index` is required when calling `get_users_count`." end path = "/2/users/count" query_params = {} query_params[:index] = index query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:tags] = unless .nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AnalyticsClient.get_users_count", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#set_client_api_key(api_key) ⇒ void
This method returns an undefined value.
Helper method to switch the API key used to authenticate the requests.
46 47 48 |
# File 'lib/algolia/api/analytics_client.rb', line 46 def set_client_api_key(api_key) @api_client.set_client_api_key(api_key) end |