Search code examples
azure-application-insights

Application Insights starttrackevent stopstrackevent across pages in a single session


I am having trouble tracking down documentation on this, so hoping someone knows as I am not able to get application insights to capture telemetry on starttrackevent and stopstrackevent across pages. This is an asp.net mvc application, so SPA is not in play here.

I am worried I may be doing something incorrectly, however the likely case is it doesn't support it.

Flow:

  • user hits site for the first time
  • user does action that triggers startTrackEvent("eventName");
  • user navigates to a new page
  • user does action that triggers stopTrackEvent("eventName");

-- from the appInsights readme https://github.com/microsoft/ApplicationInsights-JS/blob/master/README.md

appInsights.startTrackEvent("event");

appInsights.stopTrackEvent("event", null, {customProp1: "some value"});


Solution

  • Not per documentation, but via testing, can confirm that when a new page loads, appInsights will not persist start/stoptrackevent.