Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application Insight Analytics - Query Client Browser and Device

anyone knows how to query Azure App Insight to get analytics on client devices ? or OS ? I seem to be able to get good stats on Client countries but not devices

like image 432
Azure Ninja Avatar asked Jul 26 '17 01:07

Azure Ninja


3 Answers

You should have used client_CountryOrRegion in your existing queries, replace it with client_Browser Or other required data models.

Here are some queries I used to see summary on browsers..

pageViews | summarize count() by client_Browser

browserTimings | summarize avg(networkDuration), avg(processingDuration), avg(totalDuration) by name 

For more data model ref: Application Insights Export Data Model

like image 50
Arun Vinoth - MVP Avatar answered Oct 17 '22 22:10

Arun Vinoth - MVP


Or try to use this one

requests
 | project client_Type, client_Browser, client_Model, client_OS
 | limit 100
like image 26
Roman Marusyk Avatar answered Oct 17 '22 21:10

Roman Marusyk


You can get a lot of noise due to minor OS and browser variations. Here's a query that pulls the same data, but also simplifies the values so they can be grouped by more easily

// scalars
let startDate = ago(31d);
let totalCount = toscalar(pageViews | where timestamp > startDate | count);
// query
pageViews
| where timestamp > startDate
| project
    Browser = case(
        client_Browser has "Firefox", "Firefox",
        client_Browser has "Safari", "Safari",
        client_Browser has "Chrome", "Chrome",
        client_Browser has "Samsung", "Samsung",
        client_Browser has "Edg", "Edge",
        client_Browser has "Opera", "Opera",
        client_Browser has "Internet Explorer", "Internet Explorer",
        client_Browser has "Silk", "Amazon Silk",
        client_Browser has "Facebook", "Facebook",
        client_Browser has "Instagram", "Instagram",
        client_Browser has "Apple Mail", "Apple Mail",
        client_Browser has "Android WebKit", "Android WebKit",
        "Other"),
   OS = case(
        client_OS has "iOS", "iOS",
        client_OS has "Android", "Android",
        client_OS has "Mac", "Mac",
        client_OS has "Windows", "Windows",
        client_OS has "Linux", "Linux",
        client_OS has "Chrome OS", "Chrome OS",
        client_OS has "Firefox OS", "Firefox OS",
        "Other")
| summarize Freq = count() by OS, Browser
| project OS, Browser, Freq, Percent = round(100.0 * Freq / totalCount, 2)
| order by Freq desc
like image 2
KyleMit Avatar answered Oct 17 '22 22:10

KyleMit