Skip to content

Commit ccba669

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Product Analytics Server-Side Events API endpoint (#33636)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 3c16c5b commit ccba669

File tree

7 files changed

+511
-0
lines changed

7 files changed

+511
-0
lines changed

config/_default/menus/api.en.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9966,6 +9966,22 @@ menu:
99669966
- ListProcesses
99679967
unstable: []
99689968
order: 1
9969+
- name: Product Analytics
9970+
url: /api/latest/product-analytics/
9971+
identifier: product-analytics
9972+
generated: true
9973+
- name: Send server-side events
9974+
url: '#send-server-side-events'
9975+
identifier: product-analytics-send-server-side-events
9976+
parent: product-analytics
9977+
generated: true
9978+
params:
9979+
versions:
9980+
- v2
9981+
operationids:
9982+
- SubmitProductAnalyticsEvent
9983+
unstable: []
9984+
order: 1
99699985
- name: RUM
99709986
url: /api/latest/rum/
99719987
identifier: rum
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: Product Analytics
3+
---
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: Product Analytics
3+
headless: true
4+
---

content/en/api/v2/product-analytics/examples.json

Lines changed: 145 additions & 0 deletions
Large diffs are not rendered by default.

data/api/v2/full_spec.yaml

Lines changed: 333 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41478,6 +41478,114 @@ components:
4147841478
type: string
4147941479
x-enum-varnames:
4148041480
- PROCESS
41481+
ProductAnalyticsServerSideEventError:
41482+
description: Error details.
41483+
properties:
41484+
detail:
41485+
description: Error message.
41486+
example: Malformed payload
41487+
type: string
41488+
status:
41489+
description: Error code.
41490+
example: '400'
41491+
type: string
41492+
title:
41493+
description: Error title.
41494+
example: Bad Request
41495+
type: string
41496+
type: object
41497+
ProductAnalyticsServerSideEventErrors:
41498+
description: Error response.
41499+
properties:
41500+
errors:
41501+
description: Structured errors.
41502+
items:
41503+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventError'
41504+
type: array
41505+
type: object
41506+
ProductAnalyticsServerSideEventItem:
41507+
description: A Product Analytics server-side event.
41508+
properties:
41509+
account:
41510+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemAccount'
41511+
application:
41512+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemApplication'
41513+
event:
41514+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemEvent'
41515+
session:
41516+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemSession'
41517+
type:
41518+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemType'
41519+
usr:
41520+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItemUsr'
41521+
required:
41522+
- application
41523+
- event
41524+
- type
41525+
type: object
41526+
ProductAnalyticsServerSideEventItemAccount:
41527+
description: The account linked to your event.
41528+
properties:
41529+
id:
41530+
description: The account ID used in Datadog.
41531+
example: account-67890
41532+
type: string
41533+
required:
41534+
- id
41535+
type: object
41536+
ProductAnalyticsServerSideEventItemApplication:
41537+
description: The application in which you want to send your events.
41538+
properties:
41539+
id:
41540+
description: 'The application ID of your application. It can be found in
41541+
your
41542+
41543+
[application management page](https://app.datadoghq.com/rum/list).'
41544+
example: 123abcde-123a-123b-1234-123456789abc
41545+
type: string
41546+
required:
41547+
- id
41548+
type: object
41549+
ProductAnalyticsServerSideEventItemEvent:
41550+
description: Fields used for the event.
41551+
properties:
41552+
name:
41553+
description: The name of your event, which is used for search in the same
41554+
way as view or action names.
41555+
example: payment.processed
41556+
type: string
41557+
required:
41558+
- name
41559+
type: object
41560+
ProductAnalyticsServerSideEventItemSession:
41561+
description: The session linked to your event.
41562+
properties:
41563+
id:
41564+
description: The session ID captured by the SDK.
41565+
example: session-abcdef
41566+
type: string
41567+
required:
41568+
- id
41569+
type: object
41570+
ProductAnalyticsServerSideEventItemType:
41571+
description: The type of Product Analytics event. Must be `server` for server-side
41572+
events.
41573+
enum:
41574+
- server
41575+
example: server
41576+
type: string
41577+
x-enum-varnames:
41578+
- SERVER
41579+
ProductAnalyticsServerSideEventItemUsr:
41580+
description: The user linked to your event.
41581+
properties:
41582+
id:
41583+
description: The user ID used in Datadog.
41584+
example: user-12345
41585+
type: string
41586+
required:
41587+
- id
41588+
type: object
4148141589
Project:
4148241590
description: A Project
4148341591
properties:
@@ -78521,6 +78629,219 @@ paths:
7852178629
x-permission:
7852278630
operator: OPEN
7852378631
permissions: []
78632+
/api/v2/prodlytics:
78633+
post:
78634+
description: 'Send server-side events to Product Analytics. Server-side events
78635+
are retained for 15 months.
78636+
78637+
78638+
Server-Side events in Product Analytics are helpful for tracking events that
78639+
occur on the server,
78640+
78641+
as opposed to client-side events, which are captured by Real User Monitoring
78642+
(RUM) SDKs.
78643+
78644+
This allows for a more comprehensive view of the user journey by including
78645+
actions that happen on the server.
78646+
78647+
Typical examples could be `checkout.completed` or `payment.processed`.
78648+
78649+
78650+
Ingested server-side events are integrated into Product Analytics to allow
78651+
users to select and filter
78652+
78653+
these events in the event picker, similar to how views or actions are handled.
78654+
78655+
78656+
**Requirements:**
78657+
78658+
- At least one of `usr`, `account`, or `session` must be provided with a valid
78659+
ID.
78660+
78661+
- The `application.id` must reference a Product Analytics-enabled application.
78662+
78663+
78664+
**Custom Attributes:**
78665+
78666+
Any additional fields in the payload are flattened and searchable as facets.
78667+
78668+
For example, a payload with `{"customer": {"tier": "premium"}}` is searchable
78669+
with
78670+
78671+
the syntax `@customer.tier:premium` in Datadog.
78672+
78673+
78674+
The status codes answered by the HTTP API are:
78675+
78676+
- 202: Accepted: The request has been accepted for processing
78677+
78678+
- 400: Bad request (likely an issue in the payload formatting)
78679+
78680+
- 401: Unauthorized (likely a missing API Key)
78681+
78682+
- 403: Permission issue (likely using an invalid API Key)
78683+
78684+
- 408: Request Timeout, request should be retried after some time
78685+
78686+
- 413: Payload too large (batch is above 5MB uncompressed)
78687+
78688+
- 429: Too Many Requests, request should be retried after some time
78689+
78690+
- 500: Internal Server Error, the server encountered an unexpected condition
78691+
that prevented it from fulfilling the request, request should be retried after
78692+
some time
78693+
78694+
- 503: Service Unavailable, the server is not ready to handle the request
78695+
probably because it is overloaded, request should be retried after some time'
78696+
operationId: SubmitProductAnalyticsEvent
78697+
requestBody:
78698+
content:
78699+
application/json:
78700+
examples:
78701+
event-with-account:
78702+
description: Send a server-side event linked to an account.
78703+
summary: Event with account ID
78704+
value:
78705+
account:
78706+
id: account-456
78707+
application:
78708+
id: 123abcde-123a-123b-1234-123456789abc
78709+
event:
78710+
name: checkout.completed
78711+
type: server
78712+
event-with-custom-attributes:
78713+
description: Send a server-side event with additional custom attributes.
78714+
summary: Event with custom attributes
78715+
value:
78716+
application:
78717+
id: 123abcde-123a-123b-1234-123456789abc
78718+
customer:
78719+
tier: premium
78720+
event:
78721+
name: payment.processed
78722+
type: server
78723+
usr:
78724+
id: '123'
78725+
event-with-session:
78726+
description: Send a server-side event linked to a session.
78727+
summary: Event with session ID
78728+
value:
78729+
application:
78730+
id: 123abcde-123a-123b-1234-123456789abc
78731+
event:
78732+
name: form.submitted
78733+
session:
78734+
id: session-789
78735+
type: server
78736+
simple-event-with-user:
78737+
description: Send a server-side event linked to a user.
78738+
summary: Simple event with user ID
78739+
value:
78740+
application:
78741+
id: 123abcde-123a-123b-1234-123456789abc
78742+
event:
78743+
name: payment.processed
78744+
type: server
78745+
usr:
78746+
id: '123'
78747+
schema:
78748+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventItem'
78749+
description: Server-side event to send (JSON format).
78750+
required: true
78751+
responses:
78752+
'202':
78753+
content:
78754+
application/json:
78755+
schema:
78756+
type: object
78757+
description: Request accepted for processing (always 202 empty JSON).
78758+
'400':
78759+
content:
78760+
application/json:
78761+
schema:
78762+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78763+
description: Bad Request
78764+
'401':
78765+
content:
78766+
application/json:
78767+
schema:
78768+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78769+
description: Unauthorized
78770+
'403':
78771+
content:
78772+
application/json:
78773+
schema:
78774+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78775+
description: Forbidden
78776+
'408':
78777+
content:
78778+
application/json:
78779+
schema:
78780+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78781+
description: Request Timeout
78782+
'413':
78783+
content:
78784+
application/json:
78785+
schema:
78786+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78787+
description: Payload Too Large
78788+
'429':
78789+
content:
78790+
application/json:
78791+
schema:
78792+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78793+
description: Too Many Requests
78794+
'500':
78795+
content:
78796+
application/json:
78797+
schema:
78798+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78799+
description: Internal Server Error
78800+
'503':
78801+
content:
78802+
application/json:
78803+
schema:
78804+
$ref: '#/components/schemas/ProductAnalyticsServerSideEventErrors'
78805+
description: Service Unavailable
78806+
security:
78807+
- apiKeyAuth: []
78808+
servers:
78809+
- url: https://{subdomain}.{site}
78810+
variables:
78811+
site:
78812+
default: datadoghq.com
78813+
description: The regional site for customers.
78814+
enum:
78815+
- datadoghq.com
78816+
- us3.datadoghq.com
78817+
- us5.datadoghq.com
78818+
- ap1.datadoghq.com
78819+
- ap2.datadoghq.com
78820+
- datadoghq.eu
78821+
subdomain:
78822+
default: browser-intake
78823+
description: The subdomain where the API is deployed.
78824+
- url: '{protocol}://{name}'
78825+
variables:
78826+
name:
78827+
default: browser-intake-datadoghq.com
78828+
description: Full site DNS name.
78829+
protocol:
78830+
default: https
78831+
description: The protocol for accessing the API.
78832+
- url: https://{subdomain}.{site}
78833+
variables:
78834+
site:
78835+
default: datadoghq.com
78836+
description: Any Datadog deployment.
78837+
subdomain:
78838+
default: browser-intake
78839+
description: The subdomain where the API is deployed.
78840+
summary: Send server-side events
78841+
tags:
78842+
- Product Analytics
78843+
x-codegen-request-body-name: body
78844+
x-menu-order: 1
7852478845
/api/v2/product-analytics/accounts/facet_info:
7852578846
post:
7852678847
description: Get facet information for account attributes including possible
@@ -91552,6 +91873,18 @@ tags:
9155291873
See the [Live Processes page](https://docs.datadoghq.com/infrastructure/process/)
9155391874
for more information.
9155491875
name: Processes
91876+
- description: 'Send server-side events to Product Analytics. Server-Side Events Ingestion
91877+
allows you to collect custom events
91878+
91879+
from any server-side source, and retains events for 15 months. Server-side events
91880+
are helpful for understanding
91881+
91882+
causes of a funnel drop-off which are external to the client-side (for example,
91883+
payment processing error).
91884+
91885+
See the [Product Analytics page](https://docs.datadoghq.com/product_analytics/)
91886+
for more information.'
91887+
name: Product Analytics
9155591888
- description: Manage your Real User Monitoring (RUM) applications, and search or
9155691889
aggregate your RUM events over HTTP. See the [RUM & Session Replay page](https://docs.datadoghq.com/real_user_monitoring/)
9155791890
for more information

data/api/v2/translate_actions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,6 +2141,12 @@
21412141
"description": "Get all processes for your organization.",
21422142
"summary": "Get all processes"
21432143
},
2144+
"SubmitProductAnalyticsEvent": {
2145+
"description": "Send server-side events to Product Analytics. Server-side events are retained for 15 months.\n\nServer-Side events in Product Analytics are helpful for tracking events that occur on the server,\nas opposed to client-side events, which are captured by Real User Monitoring (RUM) SDKs.\nThis allows for a more comprehensive view of the user journey by including actions that happen on the server.\nTypical examples could be `checkout.completed` or `payment.processed`.\n\nIngested server-side events are integrated into Product Analytics to allow users to select and filter\nthese events in the event picker, similar to how views or actions are handled.\n\n**Requirements:**\n- At least one of `usr`, `account`, or `session` must be provided with a valid ID.\n- The `application.id` must reference a Product Analytics-enabled application.\n\n**Custom Attributes:**\nAny additional fields in the payload are flattened and searchable as facets.\nFor example, a payload with `{\"customer\": {\"tier\": \"premium\"}}` is searchable with\nthe syntax `@customer.tier:premium` in Datadog.\n\nThe status codes answered by the HTTP API are:\n- 202: Accepted: The request has been accepted for processing\n- 400: Bad request (likely an issue in the payload formatting)\n- 401: Unauthorized (likely a missing API Key)\n- 403: Permission issue (likely using an invalid API Key)\n- 408: Request Timeout, request should be retried after some time\n- 413: Payload too large (batch is above 5MB uncompressed)\n- 429: Too Many Requests, request should be retried after some time\n- 500: Internal Server Error, the server encountered an unexpected condition that prevented it from fulfilling the request, request should be retried after some time\n- 503: Service Unavailable, the server is not ready to handle the request probably because it is overloaded, request should be retried after some time",
2146+
"summary": "Send server-side events",
2147+
"request_description": "Server-side event to send (JSON format).",
2148+
"request_schema_description": "A Product Analytics server-side event."
2149+
},
21442150
"GetAccountFacetInfo": {
21452151
"description": "Get facet information for account attributes including possible values and counts",
21462152
"summary": "Get account facet info",

0 commit comments

Comments
 (0)