1

If it is even possible...

Goal: See a report of the number of views each page in my Azure web app has, and include the pages that have received zero views

Currently the page views report in Azure Application Insights that I have managed to create (based on the default report, shows all pages with >= 1 view. I would like to include in that report pages that have 0 views.

This is bare-bones version of the query I'm using in logs:

pageViews 
| where timestamp between(datetime("2020-03-06T00:00:00.000Z")..datetime("2020-06-06T00:00:00.000Z"))
| summarize Ocurrences=count() by tostring(url)

The pages are in an Azure web app.

Does anyone know how to accomplish this, either using this method or another I'm not thinking of? Thank you for any help.

hcdocs
  • 1,078
  • 2
  • 18
  • 30

1 Answers1

2

If the pages have zero view from client, it means that from client, there is no "page view" telemetry data being sent to application insights. Thus, application insights will not collect these zero-viewed page urls.

If you want to add these zero-viewd page to your report, you should hard-code these zero-viewed page urls in the query.

Here is an example, I use the datatable operator and union operator:

//use thie query to add the zero-viewd page url in this datatable
let query1=datatable (url:string,Ocurrences:long)
[
    "https://localhost:44364/home/url1",0,
    "https://localhost:44364/home/url2",0,
    "https://localhost:44364/home/url3",0,
];

//use the query below for non-zero-viewd page
let query2=pageViews 
| summarize Ocurrences=count() by tostring(url);

//union the 2 queries
union withsource=TableName query1,query2 | project url,Ocurrences

Here is the test result:

enter image description here

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60