Note Application Insights has been deprecated. Please use fiddler to monitor events.
The most exciting moments in games are when something significant happens—defeating an opponent, being defeated, moving to a location, shooting a weapon, picking a flower. By using Xbox Live, titles can share information about the important events in a player’s game. Details can be sent to the Xbox Live service, which records statistics about users. These statistics can be retrieved for use in leaderboards, matchmaking, achievements, companion experiences, and business intelligence.
The only way for a title to unlock an achievement for a player, or update a player statistic, is to send events to the Xbox Live service. Once the event, and any data that is sent as part of the event, reaches the service, Xbox Live processes rules that you defined in the service configuration for your title to create or update user statistics, achievements, leaderboards, etc.
There are two different workflows you can use, depending on if you are developing for an Xbox One console title, or for a Universal Windows Platform (UWP) app:
Note
This section applies to implementing events for Xbox One console games only. If you are creating a Universal Windows Platform app, please see the next section in this article.
A manifest is generated by XDP based on any custom events that you define. The manifest is used to create a header file for use in your title. The general workflow for games that run in the exclusive partition is as follows:
For information about the current status of XDP features that relate to generating manifests, view the XDP help, or contact your developer account manager.
XCETool.exe your-manifest.man -c your-manifestEvents.hNote
In each header, there is a method calledEventRegister{your-title}. This must be called as your app is starting up. Similarly, there is a method calledEventUnregister{your-title}. This must be called at shutdown.
For the Achievements sample, with a TitleID of 54CE29F9 and Sandbox XDKS.*, the method isEventRegisterXDKS-54CE29F9().
Your title updates statistics by raising events.
EventRegister{your-app-name}.EventWrite{event-name}.EventUnregister{your-app-name}.There are multiple ways to access statistics, depending on your need:
You can designate any individual statistic as a ranked statistic. Designating a statistic as ranked means that a leaderboard view will be generated for it that can later be queried by the Leaderboards URIs.
Define your events as usual on XDP. The API to send an event is different than that for an XDK title though, and use of the manifest file is optional.
Once you have an event and stat defined in XDP, you can perform the following steps to send an event.
If you don’t want to deal with the step of generating a manifest file and running XCETool (described in the next section), you can send an event using the WriteInGameEvent() API.
The WriteInGameEvent function is declared as:
void WriteInGameEvent(
_In_ Platform::String^ eventName,
_In_ Windows::Foundation::Collections::PropertySet^ dimensions,
_In_ Windows::Foundation::Collections::PropertySet^ measurements
);
eventName is the Event name as defined on XDP
dimensions is a property bag corresponding to event properties that take on a finite set of values. For example: level, weapon, or character.
measurements is a property bag corresponding to event properties that have an indeterminate set of values. For example: miles driven, enemies killed, or minutes played.
Dimensions and Measurements will be discussed more below.

\Tools). You create a header file for UWP applications using the -x option with xcetool. For example, if the downloaded manifest file is “Events-XDKS.1-07AB66C4.man” the command would be:xcetool Events-XDKS.1-07AB66C4.man -x events.h
This would generate an events.h file you can include in your project. You can call the functions in this file to send events to Xbox Live.
This section is most relevant if you are not using the manifest file for UWP apps. But is still worth reading even if you are using the manifest file, since it will help you better understand what is in the generated header from XCETool.
When calling WriteInGameEvent for the purposes of events on Xbox Live, there is no difference if you pass an event property as a dimension or measurement. These differences are only relevant if you are analyzing the events on Application Insights for your telemetry - this has no impact on the gameplay experience. There is more information at Application Insights API for custom events and metrics
Dimensions can be used to filter or pivot on your events. Eg: Show users to completed Level 6, or show all “Enemies Killed” events where the weapon used was “Minigun”.
Measurements could be displayed graphically or make sense to use on a leaderboard. Eg: Track time, consecutive rounds won, etc.
But for the purposes of use with Xbox Live, whether you pass an event property as a measurement or dimension makes no difference, this will be processed identically for the purposes of unlocking achievements and other Xbox Live related functionality.
Service configuration on Dev Center will be supported soon. Instructions will be provided here at that time.
If events from your title are not successfully reaching Xbox Live, then achievements will not unlock, and hero stats and leaderboards will not update. If you suspect that events are not successfully being received by Xbox Live, please try the following steps:
In your SDK install in the Tools directory, use the SwitchSandbox script to ensure you have set your sandbox to what you expect. Your service config is sandbox specific.
First ensure you have setup Fiddler according to the instructions in How to set up Fiddler for debugging
Fiddler will not show events by default since these are processed by the WinHTTP stack. You can route WinHTTP events to Fiddler by using the WinHttpFiddlerOn script in your SDK install in the Tools directory. Be sure to run the WinHttpFiddler Off script afterwards. You must run the scripts as an administrator. You can do this by right-clicking on them and selecting “Run as administrator”.
Once you have run the script, you should see events as follows in Fiddler:

Look for calls to v10.vortex-win.data.microsoft.com. You will need to decode the request body as shown, then if you look at the JSON you will see something such as the following:

You can verify the event name is what you expect. Your title ID will be prepended to the name. You should also verify you are getting a 200 return code.
Application Insights is an analytics and telemetry solution provided by Microsoft. More information is available at What is Application Insights?. The Xbox Live API integrates with Application Insights so you can see your events being sent in real-time.
For instructions on how setup Application Insights for your title, please see Application Insights for Xbox Live
You can use this to debug, since if you don’t see your events show up in Application Insights, you will not get any Achievements unlocked, stats updated, etc.
If after following these debugging steps, you are not able to resolve your issue, please post a support thread on the forums