For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/ja/api/latest/product-analytics/send-server-side-events.md. A documentation index is available at /llms.txt.
Language
Datadog site

Send server-side events

POSThttps://browser-intake-datadoghq.com/api/v2/prodlyticshttps://browser-intake-us3-datadoghq.com/api/v2/prodlyticshttps://browser-intake-us5-datadoghq.com/api/v2/prodlyticshttps://browser-intake-datadoghq.eu/api/v2/prodlyticshttps://browser-intake-ap1-datadoghq.com/api/v2/prodlyticshttps://browser-intake-ap2-datadoghq.com/api/v2/prodlyticshttps://browser-intake-uk1-datadoghq.com/api/v2/prodlyticsNot supported in the US1-FED regionNot supported in the US2-FED region

概要

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

リクエスト

Body Data (required)

Server-side event to send (JSON format).

フィールド
タイプ
説明
account
object

The account linked to your event.

application [required]
object

The application in which you want to send your events.

event [required]
object

Fields used for the event.

session
object

The session linked to your event.

type [required]
enum

The type of Product Analytics event. Must be server for server-side events.

Allowed enum values: server
usr
object

The user linked to your event.

応答

Request accepted for processing (always 202 empty JSON).

No response body

コード例

Send server-side events
## default

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with account ID
# Send a server-side event linked to an account.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "account": {
    "id": "account-456"
  },
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "checkout.completed"
  },
  "type": "server"
}
EOF

## Event with custom attributes
# Send a server-side event with additional custom attributes.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "customer": {
    "tier": "premium"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with session ID
# Send a server-side event linked to a session.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "form.submitted"
  },
  "session": {
    "id": "session-789"
  },
  "type": "server"
}
EOF

## Simple event with user ID
# Send a server-side event linked to a user.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF
## default

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-us3-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with account ID
# Send a server-side event linked to an account.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-us3-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "account": {
    "id": "account-456"
  },
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "checkout.completed"
  },
  "type": "server"
}
EOF

## Event with custom attributes
# Send a server-side event with additional custom attributes.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-us3-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "customer": {
    "tier": "premium"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with session ID
# Send a server-side event linked to a session.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-us3-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "form.submitted"
  },
  "session": {
    "id": "session-789"
  },
  "type": "server"
}
EOF

## Simple event with user ID
# Send a server-side event linked to a user.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-us3-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF
## default

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-us5-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with account ID
# Send a server-side event linked to an account.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-us5-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "account": {
    "id": "account-456"
  },
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "checkout.completed"
  },
  "type": "server"
}
EOF

## Event with custom attributes
# Send a server-side event with additional custom attributes.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-us5-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "customer": {
    "tier": "premium"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with session ID
# Send a server-side event linked to a session.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-us5-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "form.submitted"
  },
  "session": {
    "id": "session-789"
  },
  "type": "server"
}
EOF

## Simple event with user ID
# Send a server-side event linked to a user.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-us5-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF
## default

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-datadoghq.eu/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with account ID
# Send a server-side event linked to an account.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-datadoghq.eu/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "account": {
    "id": "account-456"
  },
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "checkout.completed"
  },
  "type": "server"
}
EOF

## Event with custom attributes
# Send a server-side event with additional custom attributes.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-datadoghq.eu/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "customer": {
    "tier": "premium"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with session ID
# Send a server-side event linked to a session.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-datadoghq.eu/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "form.submitted"
  },
  "session": {
    "id": "session-789"
  },
  "type": "server"
}
EOF

## Simple event with user ID
# Send a server-side event linked to a user.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-datadoghq.eu/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF
## default

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-ap1-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with account ID
# Send a server-side event linked to an account.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-ap1-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "account": {
    "id": "account-456"
  },
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "checkout.completed"
  },
  "type": "server"
}
EOF

## Event with custom attributes
# Send a server-side event with additional custom attributes.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-ap1-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "customer": {
    "tier": "premium"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with session ID
# Send a server-side event linked to a session.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-ap1-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "form.submitted"
  },
  "session": {
    "id": "session-789"
  },
  "type": "server"
}
EOF

## Simple event with user ID
# Send a server-side event linked to a user.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-ap1-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF
## default

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-ap2-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with account ID
# Send a server-side event linked to an account.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-ap2-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "account": {
    "id": "account-456"
  },
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "checkout.completed"
  },
  "type": "server"
}
EOF

## Event with custom attributes
# Send a server-side event with additional custom attributes.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-ap2-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "customer": {
    "tier": "premium"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with session ID
# Send a server-side event linked to a session.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-ap2-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "form.submitted"
  },
  "session": {
    "id": "session-789"
  },
  "type": "server"
}
EOF

## Simple event with user ID
# Send a server-side event linked to a user.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-ap2-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF
## default

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-uk1-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with account ID
# Send a server-side event linked to an account.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-uk1-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "account": {
    "id": "account-456"
  },
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "checkout.completed"
  },
  "type": "server"
}
EOF

## Event with custom attributes
# Send a server-side event with additional custom attributes.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-uk1-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "customer": {
    "tier": "premium"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF

## Event with session ID
# Send a server-side event linked to a session.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-uk1-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "form.submitted"
  },
  "session": {
    "id": "session-789"
  },
  "type": "server"
}
EOF

## Simple event with user ID
# Send a server-side event linked to a user.

# Set your Datadog credentials
export DD_API_KEY="<DD_API_KEY>"

curl -X POST "https://browser-intake-uk1-datadoghq.com/api/v2/prodlytics" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
  "application": {
    "id": "123abcde-123a-123b-1234-123456789abc"
  },
  "event": {
    "name": "payment.processed"
  },
  "type": "server",
  "usr": {
    "id": "123"
  }
}
EOF