Open VitaliyPotapov opened 1 year ago
Yes, this is by design so that the SDK completes initialization.
If you don't want this initial "pageview" then you can either not use the snippet, or add / include a telemetry initializer which will be called once the SDK has initialized (and is processing the backlog of queued events -- which will include this trackPageView) and then when you detect this just return false (to cause the event to be dropped).
The initial page view also includes a page view performace event and is the only trackPageview
that will cause this performance event to be sent. The auto route tracking (generally) does not cause this event, the only exception is that when using npm
packages the performance event is sent as part of the first trackPageview
(which is also what happens here as part of this "queued" event).
This Issue will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action.
Description/Screenshot I'm using snippet to setup AppInsights in nextjs app. I track pageView events manually by watching route changes. So that I have
enableAutoRouteTracking: false
in my app Insights config. But when using snippet interface it always sends initial pageView event. Due to that I get duplicates for initial pageView events.Steps to Reproduce
enableAutoRouteTracking = false
Open page
Expected behavior Snippet should not send
pageView
ifenableAutoRouteTracking = false
Additional context