How to remove analytics.js load?

I deployed locally and subsequently I’m about to host the app on my own cloud server; but I’ve found a problem:

My streamlit application introduces an analytics.js resource on access, which is introduced in main.xxxx.js as shown in the image below.

I guess this is a plugin for counting page views and other user behavior (I think it’s;

But the following two issues arise:

  1. this resource will slow down page loading considerably in some network situations, and will generate several post requests as the page is refreshed.

  2. This involves some user privacy and security issues; users/developers should have the right to choose whether or not to allow segment to collect data; and I can’t find a way to turn it off now.

This is causing a lot of problems for me;

I also have this problem when testing just building the simplest streamlit application without introducing any custom components;

Am I able to get rid of this resource loading by changing some configuration; or by some method.

My version of streamlit is Streamlit v1.28.2
My python version is v3.10.12

Thanks to the community and the development team for providing such a useful tool and ecosystem. I hope the good people will help me to see this problem

Hi @hylh15

You can turn off telemetry in-app by adding the following to .streamlit/config.toml in your app repo:

gatherUsageStats = false

More info in this Docs page:

And in the Privacy Policy page:

Hope this helps!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.