You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An e.g with couple of page routing for trackpageview will be very helpful, also setup the CloudRoleName. In my testing wondering where will be the best place to load the ApplicationInsight object to make it available globally for all componentes within the app. In my testing I was copy pasting the below code snipped in each component (newbie here with React)
import { ApplicationInsights, SeverityLevel } from '@microsoft/applicationinsights-web';
let INSTRUMENTATION_KEY = 'PICKING FROM ENV VARIABLE'; // Enter your instrumentation key here
let appInsights = new ApplicationInsights({config: {
instrumentationKey: INSTRUMENTATION_KEY,
maxBatchInterval: 0
}});
appInsights.loadAppInsights();
The text was updated successfully, but these errors were encountered:
You can paste it onto every component. You can also put it in your parent component and feed it down to each of your child components or some other form of abstraction. You will also need to "refresh" the SDK pageview/operation each time your router components remount.
By default the web SDK doesn't hook onto any react specific events, although I see you are checking out the react SDK, which does all of this for you 👍 (Azure/react-appinsights#38 (comment))
An e.g with couple of page routing for trackpageview will be very helpful, also setup the CloudRoleName. In my testing wondering where will be the best place to load the ApplicationInsight object to make it available globally for all componentes within the app. In my testing I was copy pasting the below code snipped in each component (newbie here with React)
import { ApplicationInsights, SeverityLevel } from '@microsoft/applicationinsights-web';
let INSTRUMENTATION_KEY = 'PICKING FROM ENV VARIABLE'; // Enter your instrumentation key here
let appInsights = new ApplicationInsights({config: {
instrumentationKey: INSTRUMENTATION_KEY,
maxBatchInterval: 0
}});
appInsights.loadAppInsights();
The text was updated successfully, but these errors were encountered: