Using Application Insights in a Windows Store application

January 28, 2014 -


Few months ago Microsoft announced the release of Visual Studio Online (VSO). One of the new feature that comes with VSO is Application Insights. It allows to monitor the performances of your applications and to find out what your users are doing the most or the less in your app. This kind of information may be very useful to optimize users’ experience in your app or propose new feature, based on behavior analysis.

Declare an application in the Visual Studio Online dashboard

Before using Application Insights, you have to declare the application in your dashboard on the VSO website. Go to your dashboard and click the item “Try Application Insights” :


In the Add application section, follow the wizard to declare a Windows Store app


Name your application an copy the generated ID.

You are now ready to use application insights in your app.

How do I set up Application Insights in my project ?

Setting up Application Insights in a Windows Store application is very easy. First, you should change the build configuration of your application and choose between x64, x86 and ARM. Any CPU is not supported because application insights is distributed as a winmd native component.


Once you have changed the build configuration of your projet, you can search for a Nuget package named Application Insights Telemetry SDK for Windows Store Apps :


Do not waste time to look for the reference in your project after you have installed the package, it will be visible only after Visual Studio has been restarted (don’t ask why, it was the case for me… Smile).

Build the solution and check you have no error in the console.

Using the Application Insights SDK in your application

The API is really easy to use. In the namespace Microsoft.ApplicationInsights.Telemetry.WindowsStore, you will find a class ClientAnalyticsSession that exposes a property Default. There are three interesting methods on this object :

  • Start : takes the id of your application insights app and starts the analytics session
  • LogEvent : logs a given event in your application (users behavior, most of the time)
  • LogPageView : logs a page view

Now, you can implement your own tag plan in your app. You just have to call the Start method when your application launches and it’s ok !

Application Insights, for what kind of information ?

Application Insights allows to get some performance information about your application, but also monitor usage patterns in the application. For example, you can know what are the versions most used by your users :


You can also check the different resolutions or hardware of your users :


Or the languages :


And of course the detail of each event that occurs in the application and that you have triggered through the API :



As you can see, it is really easy to use Application Insights in a Windows Store application and the dashboard on the VSO website is very cool and very useful to read all the information about your application.

So do not hesitate anymore, use it !

Hope this helps !

Julien Winking smile





Announcing general availability of @Azure database services for #MySQL and #PostgreSQL

March 22, 2018 09:59

Running your private #Kubernetes cluster on #Azure with ACS Engine

March 21, 2018 06:34

How to expose your #Kubernetes workloads on @Azure

March 18, 2018 11:22

RT @as_w: .@Azure Container Instances (ACI) across 3 regions in under 30 seconds with Azure Traffic Manager by @as_w

March 17, 2018 09:41

RT @nepeters: Integrate #Azure storage into your #Kubernetes deployments with Open Service Broker for Azure. Give it a spin with this ready…

March 17, 2018 09:40

RT @AzureFunctions: Great stuff from @jeffhollan! Reliable messaging with Functions and Event Hubs.

March 15, 2018 22:22

Bonsoir @SFR @SFR_SAV, pour la 23ème fois depuis le 28 janvier, coupure de la fibre ! Synchro KO. Quand est-ce que…

March 15, 2018 21:10

@nlamirault @KubernetesParis @sferquel L'intérêt est d'avoir un cluster kubernetes local sur le poste de dev, rempl…

March 15, 2018 13:13

@NicoRobPro @Uber Ouais, et puis après il a repris le périph à l'envers, et après il a oublié de tourner à gauche d…

March 15, 2018 07:49

And for those who want to try Service Catalog + Open Service Broker on @Azure with Azure #Container Service (AKS),…

March 15, 2018 07:45

Slides from my talk @KubernetesParis meetup yesterday about #Kubernetes Service Catalog and Open Service Broker for…

March 15, 2018 07:43

@KubernetesParis @sferquel @joinstationf @Docker @kubernetesio Merci ! Mes slides sont dispo ici :

March 15, 2018 07:42

Pourquoi faire simple quand on peut faire compliqué ^^ arrivée en beauté : "wesh faut que j'arrête et que je dorme…

March 14, 2018 23:04

Quand ton chauffeur @Uber sait pas utiliser Waze et transforme un trajet de 10 minutes en 30 minutes en arrêtant pa…

March 14, 2018 22:52

RT @thomasjkerjean: C’est avec fierté que nous @microsoftfrance ouvrons aujourd’hui nos Datacenters à Paris & Marseille! @BJavelot @jblefev

March 14, 2018 22:46