Class: DatadogAPIClient::V2::ProductAnalyticsAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v2/api/product_analytics_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ ProductAnalyticsAPI

Returns a new instance of ProductAnalyticsAPI.



22
23
24
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 22

def initialize(api_client = DatadogAPIClient::APIClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_client ⇒ Object

Returns the value of attribute api_client.



20
21
22
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

#query_product_analytics_journey_funnel(body, opts = {}) ⇒ Object

Compute journey funnel analysis.



29
30
31
32
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 29

def query_product_analytics_journey_funnel(body, opts = {})
  data, _status_code, _headers = query_product_analytics_journey_funnel_with_http_info(body, opts)
  data
end

#query_product_analytics_journey_funnel_with_http_info(body, opts = {}) ⇒ Array<(ProductAnalyticsJourneyFunnelResponse, Integer, Hash)>

Compute journey funnel analysis.

Compute a funnel over an ordered sequence of Product Analytics events. Returns the per-step conversion counts, conversion rates, and elapsed times, optionally segmented by group-by facets.

Parameters:

Returns:



43
44
45
46
47
48
49
50
51
52
53
54
55
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 43

def query_product_analytics_journey_funnel_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.query_product_analytics_journey_funnel".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.query_product_analytics_journey_funnel")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.query_product_analytics_journey_funnel"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_journey_funnel ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_journey_funnel"
  end
  # resource path
  local_var_path = '/api/v2/product-analytics/journey/funnel'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProductAnalyticsJourneyFunnelResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :query_product_analytics_journey_funnel,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_journey_funnel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_product_analytics_journey_list(body, opts = {}) ⇒ Object

List journey entities.



104
105
106
107
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 104

def query_product_analytics_journey_list(body, opts = {})
  data, _status_code, _headers = query_product_analytics_journey_list_with_http_info(body, opts)
  data
end

#query_product_analytics_journey_list_with_http_info(body, opts = {}) ⇒ Array<(ProductAnalyticsJourneyListResponse, Integer, Hash)>

List journey entities.

Return the individual sessions that reached, or dropped off at, a given step of the journey. Each row contains the identity join key, the event timestamp, and the columns requested in entity_columns.

Parameters:

Returns:



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
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
168
169
170
171
172
173
174
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 118

def query_product_analytics_journey_list_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.query_product_analytics_journey_list".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.query_product_analytics_journey_list")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.query_product_analytics_journey_list"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_journey_list ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_journey_list"
  end
  # resource path
  local_var_path = '/api/v2/product-analytics/journey/list'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProductAnalyticsJourneyListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :query_product_analytics_journey_list,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_journey_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_product_analytics_journey_scalar(body, opts = {}) ⇒ Object

Compute journey scalar analytics.



179
180
181
182
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 179

def query_product_analytics_journey_scalar(body, opts = {})
  data, _status_code, _headers = query_product_analytics_journey_scalar_with_http_info(body, opts)
  data
end

#query_product_analytics_journey_scalar_with_http_info(body, opts = {}) ⇒ Array<(ProductAnalyticsJourneyScalarResponse, Integer, Hash)>

Compute journey scalar analytics.

Compute scalar results for a journey query, such as the conversion count, the conversion rate, or the time to convert, optionally segmented by group-by facets.

Parameters:

Returns:



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 192

def query_product_analytics_journey_scalar_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.query_product_analytics_journey_scalar".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.query_product_analytics_journey_scalar")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.query_product_analytics_journey_scalar"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_journey_scalar ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_journey_scalar"
  end
  # resource path
  local_var_path = '/api/v2/product-analytics/journey/scalar'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProductAnalyticsJourneyScalarResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :query_product_analytics_journey_scalar,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_journey_scalar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_product_analytics_journey_timeseries(body, opts = {}) ⇒ Object

Compute journey timeseries analytics.



253
254
255
256
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 253

def query_product_analytics_journey_timeseries(body, opts = {})
  data, _status_code, _headers = query_product_analytics_journey_timeseries_with_http_info(body, opts)
  data
end

#query_product_analytics_journey_timeseries_with_http_info(body, opts = {}) ⇒ Array<(ProductAnalyticsJourneyTimeseriesResponse, Integer, Hash)>

Compute journey timeseries analytics.

Compute timeseries results for a journey query. Returns one series per group-by combination, bucketed by the requested interval.

Parameters:

Returns:



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
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
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 266

def query_product_analytics_journey_timeseries_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.query_product_analytics_journey_timeseries".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.query_product_analytics_journey_timeseries")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.query_product_analytics_journey_timeseries"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_journey_timeseries ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_journey_timeseries"
  end
  # resource path
  local_var_path = '/api/v2/product-analytics/journey/timeseries'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProductAnalyticsJourneyTimeseriesResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :query_product_analytics_journey_timeseries,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_journey_timeseries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_product_analytics_list(body, opts = {}) ⇒ Object

List analytics events.



327
328
329
330
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 327

def query_product_analytics_list(body, opts = {})
  data, _status_code, _headers = query_product_analytics_list_with_http_info(body, opts)
  data
end

#query_product_analytics_list_with_http_info(body, opts = {}) ⇒ Array<(ProductAnalyticsAnalyticsListResponse, Integer, Hash)>

List analytics events.

List the individual event records matching an analytics query. Use columns to choose the attributes returned on each row, sort to order the rows, and limit to cap how many are returned.

Parameters:

Returns:



341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
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
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 341

def query_product_analytics_list_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.query_product_analytics_list".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.query_product_analytics_list")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.query_product_analytics_list"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_list ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_list"
  end
  # resource path
  local_var_path = '/api/v2/product-analytics/analytics/list'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProductAnalyticsAnalyticsListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :query_product_analytics_list,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_product_analytics_retention_grid(body, opts = {}) ⇒ Object

Compute a retention grid.



402
403
404
405
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 402

def query_product_analytics_retention_grid(body, opts = {})
  data, _status_code, _headers = query_product_analytics_retention_grid_with_http_info(body, opts)
  data
end

#query_product_analytics_retention_grid_with_http_info(body, opts = {}) ⇒ Array<(ProductAnalyticsRetentionGridResponse, Integer, Hash)>

Compute a retention grid.

Compute a retention grid, showing how much of each cohort came back over each subsequent period. Rows are cohorts, columns are return periods, and each cell holds the count and rate of entities that returned.

Parameters:

Returns:



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
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 415

def query_product_analytics_retention_grid_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.query_product_analytics_retention_grid".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.query_product_analytics_retention_grid")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.query_product_analytics_retention_grid"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_retention_grid ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_retention_grid"
  end
  # resource path
  local_var_path = '/api/v2/product-analytics/retention/grid'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProductAnalyticsRetentionGridResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :query_product_analytics_retention_grid,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_retention_grid\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_product_analytics_retention_list(body, opts = {}) ⇒ Object

List the entities behind a retention cell.



476
477
478
479
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 476

def query_product_analytics_retention_list(body, opts = {})
  data, _status_code, _headers = query_product_analytics_retention_list_with_http_info(body, opts)
  data
end

#query_product_analytics_retention_list_with_http_info(body, opts = {}) ⇒ Array<(ProductAnalyticsRetentionListResponse, Integer, Hash)>

List the entities behind a retention cell.

List the individual users or accounts counted in one cell of the retention grid. Set computation_scope to the cohort and return period you want to examine.

Parameters:

Returns:



489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 489

def query_product_analytics_retention_list_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.query_product_analytics_retention_list".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.query_product_analytics_retention_list")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.query_product_analytics_retention_list"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_retention_list ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_retention_list"
  end
  # resource path
  local_var_path = '/api/v2/product-analytics/retention/list'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProductAnalyticsRetentionListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :query_product_analytics_retention_list,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_retention_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_product_analytics_retention_scalar(body, opts = {}) ⇒ Object

Compute retention scalar values.



550
551
552
553
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 550

def query_product_analytics_retention_scalar(body, opts = {})
  data, _status_code, _headers = query_product_analytics_retention_scalar_with_http_info(body, opts)
  data
end

#query_product_analytics_retention_scalar_with_http_info(body, opts = {}) ⇒ Array<(ProductAnalyticsScalarResponse, Integer, Hash)>

Compute retention scalar values.

Compute retention as a single value per group, suitable for a query value or top list widget.

Parameters:

Returns:



562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
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
609
610
611
612
613
614
615
616
617
618
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 562

def query_product_analytics_retention_scalar_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.query_product_analytics_retention_scalar".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.query_product_analytics_retention_scalar")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.query_product_analytics_retention_scalar"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_retention_scalar ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_retention_scalar"
  end
  # resource path
  local_var_path = '/api/v2/product-analytics/retention/scalar'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProductAnalyticsScalarResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :query_product_analytics_retention_scalar,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_retention_scalar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_product_analytics_retention_timeseries(body, opts = {}) ⇒ Object

Compute retention timeseries.



623
624
625
626
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 623

def query_product_analytics_retention_timeseries(body, opts = {})
  data, _status_code, _headers = query_product_analytics_retention_timeseries_with_http_info(body, opts)
  data
end

#query_product_analytics_retention_timeseries_with_http_info(body, opts = {}) ⇒ Array<(ProductAnalyticsTimeseriesResponse, Integer, Hash)>

Compute retention timeseries.

Compute retention as a series of values over time, using the same query definition as the retention grid.

Parameters:

Returns:



636
637
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
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 636

def query_product_analytics_retention_timeseries_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.query_product_analytics_retention_timeseries".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.query_product_analytics_retention_timeseries")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.query_product_analytics_retention_timeseries"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_retention_timeseries ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_retention_timeseries"
  end
  # resource path
  local_var_path = '/api/v2/product-analytics/retention/timeseries'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProductAnalyticsTimeseriesResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :query_product_analytics_retention_timeseries,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_retention_timeseries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_product_analytics_sankey(body, opts = {}) ⇒ Object

Compute a Sankey diagram.



697
698
699
700
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 697

def query_product_analytics_sankey(body, opts = {})
  data, _status_code, _headers = query_product_analytics_sankey_with_http_info(body, opts)
  data
end

#query_product_analytics_sankey_with_http_info(body, opts = {}) ⇒ Array<(ProductAnalyticsSankeyResponse, Integer, Hash)>

Compute a Sankey diagram.

Compute a Sankey diagram of how sessions flow between the values of two facets, showing where users continue and where they drop off at each step.

Parameters:

Returns:



710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 710

def query_product_analytics_sankey_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.query_product_analytics_sankey".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.query_product_analytics_sankey")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.query_product_analytics_sankey"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_sankey ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_sankey"
  end
  # resource path
  local_var_path = '/api/v2/product-analytics/sankey'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProductAnalyticsSankeyResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :query_product_analytics_sankey,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_sankey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_product_analytics_scalar(body, opts = {}) ⇒ Object

Compute scalar analytics.



771
772
773
774
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 771

def query_product_analytics_scalar(body, opts = {})
  data, _status_code, _headers = query_product_analytics_scalar_with_http_info(body, opts)
  data
end

#query_product_analytics_scalar_with_http_info(body, opts = {}) ⇒ Array<(ProductAnalyticsScalarResponse, Integer, Hash)>

Compute scalar analytics.

Compute scalar analytics results for Product Analytics data. Returns aggregated values (counts, averages, percentiles) optionally grouped by facets.

Parameters:

Returns:



784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
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
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 784

def query_product_analytics_scalar_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_scalar ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_scalar"
  end
  # resource path
  local_var_path = '/api/v2/product-analytics/analytics/scalar'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProductAnalyticsScalarResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :query_product_analytics_scalar,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_scalar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_product_analytics_timeseries(body, opts = {}) ⇒ Object

Compute timeseries analytics.



839
840
841
842
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 839

def query_product_analytics_timeseries(body, opts = {})
  data, _status_code, _headers = query_product_analytics_timeseries_with_http_info(body, opts)
  data
end

#query_product_analytics_timeseries_with_http_info(body, opts = {}) ⇒ Array<(ProductAnalyticsTimeseriesResponse, Integer, Hash)>

Compute timeseries analytics.

Compute timeseries analytics results for Product Analytics data. Returns time-bucketed values for charts and trend analysis. The compute.interval field (milliseconds) is required for time bucketing.

Parameters:

Returns:



853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 853

def query_product_analytics_timeseries_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.query_product_analytics_timeseries ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.query_product_analytics_timeseries"
  end
  # resource path
  local_var_path = '/api/v2/product-analytics/analytics/timeseries'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'ProductAnalyticsTimeseriesResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :query_product_analytics_timeseries,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductAnalyticsAPI#query_product_analytics_timeseries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit_product_analytics_event(body, opts = {}) ⇒ Object

Send server-side events.



908
909
910
911
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 908

def submit_product_analytics_event(body, opts = {})
  data, _status_code, _headers = submit_product_analytics_event_with_http_info(body, opts)
  data
end

#submit_product_analytics_event_with_http_info(body, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Send server-side events.

Send server-side events to Product Analytics. Server-side events are retained for 15 months.

Server-Side events in Product Analytics are helpful for tracking events that occur on the server, as opposed to client-side events, which are captured by Real User Monitoring (RUM) SDKs. This allows for a more comprehensive view of the user journey by including actions that happen on the server. Typical examples could be checkout.completed or payment.processed.

Ingested server-side events are integrated into Product Analytics to allow users to select and filter these events in the event picker, similar to how views or actions are handled.

Requirements:

  • At least one of usr, account, or session must be provided with a valid ID.
  • The application.id must reference a Product Analytics-enabled application.

Custom Attributes: Any additional fields in the payload are flattened and searchable as facets. For example, a payload with {"customer": {"tier": "premium"}} is searchable with the syntax @customer.tier:premium in Datadog.

The status codes answered by the HTTP API are:

  • 202: Accepted: The request has been accepted for processing
  • 400: Bad request (likely an issue in the payload formatting)
  • 401: Unauthorized (likely a missing API Key)
  • 403: Permission issue (likely using an invalid API Key)
  • 408: Request Timeout, request should be retried after some time
  • 413: Payload too large (batch is above 5MB uncompressed)
  • 429: Too Many Requests, request should be retried after some time
  • 500: Internal Server Error, the server encountered an unexpected condition that prevented it from fulfilling the request, request should be retried after some time
  • 503: Service Unavailable, the server is not ready to handle the request probably because it is overloaded, request should be retried after some time

Parameters:

Returns:

  • (Array<(Object, Integer, Hash)>) —

    Object data, response status code and response headers



948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
# File 'lib/datadog_api_client/v2/api/product_analytics_api.rb', line 948

def submit_product_analytics_event_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.submit_product_analytics_event ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.submit_product_analytics_event"
  end
  # resource path
  local_var_path = '/api/v2/prodlytics'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth]

  new_options = opts.merge(
    :operation => :submit_product_analytics_event,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductAnalyticsAPI#submit_product_analytics_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end