Ensuring use of new Operation.id in pageView tracking RRS feed

  • Question

  • In Angular 5 using 'applicationinsights-js' I am having trouble getting new operationIds to be generated for each page view.

    My expectation: Each trackPageView (or in my case typically startTrackPage ) should generate a new operation Id to associate API calls and pageview duration for later viewing.

    In reality: It seems that the only way to ensure a new operationId is to run downloadAndSetup(this.config), which in my case is very much not preferred.

    My question: Is there something I'm doing incorrectly in my use of pageView tracking, or at least is there a correct conventional way to set a new operationId? I know that I can access AppInsights.context.operation.id...is that how I'm intended to change it? I would prefer that this be handled automatically

    Monday, September 9, 2019 9:17 PM


  • For anyone who may run into this issue in the future – the question has been answered elsewhere.

    The operation ID is only set once in my version of AppInsights (really not tuned for SPAs) – the latest version – npmjs(dot)com/package/@microsoft/applicationinsights-web - can use another setting called enableAutoRouteTracking to accomplish this automatically.



    In my case the operation ID needs to be manually changed before startTrackPage() or trackPageView()

    Monday, September 9, 2019 10:56 PM