Flying in the Dark? Add Instrumentation


So… Windows 10 has been out for a while now.  Have you noticed an uptick in downloads?  Where are your downloads coming from and from whom?  In this blog I often lament about my own shortcomings and then, hopefully, fill in what I did to overcome them with the intent that others might also benefit.  I have more than a few apps in the store and continue to get downloads (and yes my Windows app downloads are increasing). 

I have been using the Dev Center Dashboard, Advertising PubCenter (now converted to Dev Center) and AdDuplex to get metrics on my app.  They have been pretty good but there are some downsides too.  Most of those sites have a slight delay, maybe a day or two in providing the details.  Most of the time that’s ok.  But when I release a new app or update I need to know as quickly as possible what is happening so I can react, if necessary, to issues and trends.  As a happy coincidence Microsoft Azure along with Visual Studio provide a nice easy way to get whatever metrics you can possibly imagine in almost real time.  Application Insights is available at pretty much no charge (unless you have a massive number of users using your app, in which case there is a small subscription model offered).

imageTo add App Insights to your app, open it in Visual Studio and then click on the Tools/Add Application Insights Telemetry menu. You do need a Microsoft Azure account but if you are just going to use Application Insights you get 5 million bits of information you can collect per month for free.  That’s a whole lot of information.  All you have to do after that is follow the steps provided and your app will be hooked up.  Data will start flowing to Azure even if you are running in debug mode in the Visual Studio IDE.

By default you get a whole bunch of information without having to do anything but select that menu above.  You get notice of what pages your users are opening, what devices they are using, how long they are using their app, how often they use your app and a whole bunch of other bits of information.  However, what you really want to consider is adding custom events.  This allows you to track if specific buttons are pressed or IAP’s purchased or anything else you can think of.  For example, I instrumented the “purchase feature ‘A’” button and then instrumented if they actually successfully purchased the item.  This told me right away that many where pressing the purchase button but very few were buying the feature.  So either my pricing was too high or I needed to better describe the feature so they would want it.  Either way I was able to figure out that people were interested enough in the feature.

Adding a custom event is as simple as a single line of code at the point you want to register the event.  Adding Application Insights to your app automatically adds a static public variable called “TelemetryClient” to your App.xaml.cs file.  Call the TrackEvent method and away you go.  In my case I added an event when the “buy” button is purchased and then this one when the store process reports that the in-app-purchase is active.

Code Snippet
  1. App.TelemetryClient.TrackEvent(“Product Purchased: “ + InAppProductKey);

imageInside Azure in the new Portal view you can see the list of custom events, how many times the events happen and when they happen along with a bunch more information related to users and sessions.  In this example they hit the button to purchase the Photo Viewer feature 139 times but only purchased 3 times.  So I need to look at the pricing and description of the feature to try and raise the number of buys.

Adding Application Insights to your app will help you understand not only if users are downloading your app but how they are using it, what features they like or avoid and how often they use it but any custom events you can possibly think of that will give you a better understanding of where you can focus your development thus saving you time and increasing the efficiency of your work.

Good luck and happy information gathering.

Comments (0)

Skip to main content