POSThttps://browser-intake-ap1-datadoghq.com/api/v2/prodlyticshttps://browser-intake-ap2-datadoghq.com/api/v2/prodlyticshttps://browser-intake-datadoghq.eu/api/v2/prodlyticshttps://browser-intake-datadoghq.com/api/v2/prodlyticshttps://browser-intake-us3-datadoghq.com/api/v2/prodlyticshttps://browser-intake-us5-datadoghq.com/api/v2/prodlyticsNot supported in the GOV regionNot supported in the GOV2 regionNot supported in the UK1 region
Présentation
Envoyer des événements côté serveur à Product Analytics. Les événements côté serveur sont conservés pendant 15 mois.
Les événements côté serveur dans Product Analytics sont utiles pour suivre les événements qui se produisent sur le serveur,
par opposition aux événements côté client, qui sont capturés par les SDK Real User Monitoring (RUM).
Cela permet d’obtenir une vue plus complète du parcours utilisateur en incluant les actions qui se produisent sur le serveur.
Des exemples typiques pourraient être checkout.completed ou payment.processed.
Les événements côté serveur ingérés sont intégrés dans Product Analytics pour permettre aux utilisateurs de sélectionner et de filtrer
ces événements dans le sélecteur d’événements, de la même manière que les vues ou les actions sont gérées.
Prérequis :
Au moins l’un des champs usr, account ou session doit être fourni avec un ID valide.
L’application.id doit référencer une application avec Product Analytics activé.
Attributs personnalisés :
Tous les champs supplémentaires de la charge utile sont aplatis et consultables en tant que facettes.
Par exemple, une charge utile contenant {"customer": {"tier": "premium"}} est consultable avec
la syntaxe @customer.tier:premium dans Datadog.
Les codes de statut renvoyés par l’API HTTP sont :
202 : accepté : la requête a été acceptée pour traitement
400 : requête incorrecte (probablement un problème de formatage de la charge utile)
401 : non autorisé (probablement une clé API manquante)
403 : problème d’autorisation (probablement une clé API invalide)
408 : délai d’attente de la requête, la requête doit être retentée après un certain délai
413 : charge utile trop volumineuse (le lot dépasse 5 Mo non compressé)
429 : trop de requêtes, la requête doit être retentée après un certain délai
500 : erreur interne du serveur, le serveur a rencontré une condition inattendue l’empêchant de traiter la requête, celle-ci doit être retentée après un certain délai
503 : service indisponible, le serveur n’est pas en mesure de traiter la requête, probablement en raison d’une surcharge, la requête doit être retentée après un certain délai.
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comNot supported in the UK1 regionNot supported in the US1-FED regionNot supported in the US2-FED region"DD_API_KEY="<DD_API_KEY>"python3"example.py"
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comNot supported in the UK1 regionNot supported in the US1-FED regionNot supported in the US2-FED region"DD_API_KEY="<DD_API_KEY>"rb"example.rb"
// Send server-side events returns "Request accepted for processing (always 202 empty JSON)." responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){body:=datadogV2.ProductAnalyticsServerSideEventItem{Account:&datadogV2.ProductAnalyticsServerSideEventItemAccount{Id:"account-67890",},Application:datadogV2.ProductAnalyticsServerSideEventItemApplication{Id:"123abcde-123a-123b-1234-123456789abc",},Event:datadogV2.ProductAnalyticsServerSideEventItemEvent{Name:"payment.processed",},Session:&datadogV2.ProductAnalyticsServerSideEventItemSession{Id:"session-abcdef",},Type:datadogV2.PRODUCTANALYTICSSERVERSIDEEVENTITEMTYPE_SERVER,Usr:&datadogV2.ProductAnalyticsServerSideEventItemUsr{Id:"user-12345",},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewProductAnalyticsApi(apiClient)resp,r,err:=api.SubmitProductAnalyticsEvent(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `ProductAnalyticsApi.SubmitProductAnalyticsEvent`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `ProductAnalyticsApi.SubmitProductAnalyticsEvent`:\n%s\n",responseContent)}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comNot supported in the UK1 regionNot supported in the US1-FED regionNot supported in the US2-FED region"DD_API_KEY="<DD_API_KEY>"go run"main.go"
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comNot supported in the UK1 regionNot supported in the US1-FED regionNot supported in the US2-FED region"DD_API_KEY="<DD_API_KEY>"java"Example.java"
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comNot supported in the UK1 regionNot supported in the US1-FED regionNot supported in the US2-FED region"DD_API_KEY="<DD_API_KEY>"cargo run
/**
* Send server-side events returns "Request accepted for processing (always 202 empty JSON)." response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.ProductAnalyticsApi(configuration);constparams: v2.ProductAnalyticsApiSubmitProductAnalyticsEventRequest={body:{account:{id:"account-67890",},application:{id:"123abcde-123a-123b-1234-123456789abc",},event:{name:"payment.processed",},session:{id:"session-abcdef",},type:"server",usr:{id:"user-12345",},},};apiInstance.submitProductAnalyticsEvent(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comNot supported in the UK1 regionNot supported in the US1-FED regionNot supported in the US2-FED region"DD_API_KEY="<DD_API_KEY>"tsc"example.ts"
Request a personalized demo
Commencer avec Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.