chenxu
chenxu

Reputation: 71

Application insights page view loss

I'm using application insights javascript sdk in a website by snippet. I found that if I open the website and then close the page very quickly, the page view events were loss. But if I use other telemetry capture sdk, the events can be captured. I have already set the "maxBatchInterval" as 0 and the sampling related configuration is by default. Is there any way to avoid data loss in this situation for application insights?

Upvotes: 0

Views: 360

Answers (1)

Delliganesh Sevanesan
Delliganesh Sevanesan

Reputation: 4776

The issue happens because of SDK doesn't load or initialize. Refer MSDOC for more information.

any way to avoid data loss in this situation for application insights?

Yes, we can get all the telemetry data without loss.

I hope you are using the updated latest version of SDK V2.

You can use autoTrackPageVisitTime has true configuration to view the page view time of the current page.

After, you can measure the duration of the page so that it will send the duration information to the Application Insights using trackpageView.

appInsights.trackPageView({ name: 'pageview with duration = 00:00:30.000', properties: { duration: 500000 } });

Upvotes: 0

Related Questions