hcdocs
hcdocs

Reputation: 1299

Custom tags applied to Azure web app pages in Azure Application Insights

Use case: Categorizing page views in an Azure web app for analytics reporting

Using Azure Application Insights, I can see a list of pages in an Azure web app and its number of views in the past X days.

The web app is a documentation website. I would like to categorize each page with a tag like install-info or api-doc or intro-material, etc. The goal is that I can easily see information like "X number of page views were around install information" or "API pages received 25% of traffic," etc.

Currently I am exporting a table of each page and its number of views. Then I manually categorize each page in Excel. There are hundreds of pages. I would love to export a table that included a third column showing the page's custom tag.

Looking at Microsoft documentation, it sounds like this is possible with custom coding and the API, but I would like a simpler strategy if one exists, as I am not a sophisticated coder.

If there are alternative methods of achieving my goal than the solution I'm asking about in this question, I would be grateful to know.

Thank you.

Upvotes: 0

Views: 290

Answers (1)

Ivan Glasenberg
Ivan Glasenberg

Reputation: 29950

If I understood you correctly, you want to add an extra tag(column) for different kind of url, right?

If that's the case, you can take use of case and extend statement of kusto.

Here is an sample code:

pageViews 
| where name contains "WebApplication5"
| extend mytags = case(
    //here, I'm using name for each condition, you can use other field as per your need.
    name=="Home Page - WebApplication5","index page",
    name=="Privacy Policy - WebApplication5","privacy page",
    "others"
)
| project name,mytags

Then export the result. The test result is as below:

enter image description here

Please feel free to modify this code to meet your requirement, and also let me know if you still have more issues about that.

Upvotes: 1

Related Questions