8

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

1
  • What specific metric are you looking to track? The Metric Explorer will let you group by Device Type and Device Model. Happy to share a screenshot that shows the specifics if you can elaborate on what metric you're looking for. Commented Jul 26, 2017 at 3:39

3 Answers 3

8

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

6

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
1
  • Nice! Is it also possible to see the os version?
    – Remi
    Commented Jun 19, 2023 at 14:07
4

Or try to use this one

requests
 | project client_Type, client_Browser, client_Model, client_OS
 | limit 100

Not the answer you're looking for? Browse other questions tagged or ask your own question.