ApplicationInsights-JS icon indicating copy to clipboard operation
ApplicationInsights-JS copied to clipboard

How to control automatic injection?

Open NoahStahl opened this issue 8 years ago • 5 comments

Both Visual Studio and Azure App Services extensions for AI apparently inject the script snippet automatically. How can I disable this and include the script statically as shown in the readme? Currently doing that results in the snippet on the page twice resulting in duplicate page view calls.

(ASP.NET Core 2.0, VS 2017 15.5, Azure App Service AI extension 2.4.6)

NoahStahl avatar Dec 06 '17 19:12 NoahStahl

@cijothomas please help here

SergeyKanzhelev avatar Dec 06 '17 23:12 SergeyKanzhelev

@KamilSzostak, @YuliaSafarova I thought double inclusion should not send two pageViews? I believe you did it for Azure Web Apps scenarios. Is it not the case?

SergeyKanzhelev avatar Dec 06 '17 23:12 SergeyKanzhelev

(I also started a StackOverflow question before I found this repo)

NoahStahl avatar Dec 06 '17 23:12 NoahStahl

Yes, pageview events shouldn't be duplicated. Are you using the latest snippet from the README file?

KamilSzostak avatar Jan 10 '18 17:01 KamilSzostak

I switched over to relying on the environment to inject the script (Visual Studio locally and Azure App Service extension), because I never found a way to stop it. If I find that to be configurable, I may revisit.

NoahStahl avatar Jan 10 '18 18:01 NoahStahl