1

As I know, Application Insights uses page title as View page name. But my application has simillar page title for all pages. And that is why I always get only one pageview and can`t create propper userflow graph, because AI displays, that user visit only one page all the time. User flow graph with one pageview

That is why I added this TelemetryInitializer on client side to track pageview by href but I am not shure if it is a right approach.

const telemetryInitializer = envelope => {
            envelope.baseData.name = window.location.href;
        };

appInsights.addTelemetryInitializer(telemetryInitializer);

Maybe Azure Team has any other way to do it without changing page title?

1 Answers1

0

There are a variety of ways to approach this. Application Insights User Flows starts from a page view, custom event, or exception that you specify. In my example below, I've used custom events. A custom event in JavaScript might look like this:

appInsights.trackEvent({name:"SuccessfulUserLogin"});

(For detailed instructions on how to log custom events, see the documentation on TrackEvent.)

Here I've used the custom event "SuccessfulUserLogin" as the Initial Event in Application Insights to create a User Flows graph:

Application Insights User Flows settings

That in turn allowed me to track the user flow using the custom events that I specified on other pages (tracking the custom event "VisitedUserForum" on the user forum page and "VisitedFeedbackForum" on the feedback forum page even if both pages were named "forums"):

Application Insights User Flow based on custom events

kobulloc
  • 251
  • 1
  • 3