Hi
I have an app that would be accessed globally. How can I access the country as well as the time from each person who uses the app? (Currently, the app would only provide these details based on where the app is hosted, right?)
Cheers
Hi
I have an app that would be accessed globally. How can I access the country as well as the time from each person who uses the app? (Currently, the app would only provide these details based on where the app is hosted, right?)
Cheers
Hi @Shawn_Pereira,
Thanks for sharing this question! Is this app running locally or hosted on Community Cloud (or elsewhere)? You’re right that whether your app has access to this info depends on where the app is running/hosted
Thanks for responding, @Caroline. I forgot to mention that the app is being hosted on Streamlit cloud.
I wish to get the country and time info of each user via the code rather than other methods (developer access to analytics, etc…).
Is this possible with Streamlit?
Cheers
Hi @Shawn_Pereira,
Community Cloud doesn’t enable logging of IP addresses (mainly due to privacy implications), which would be the main way to get the viewer’s country (feel free to share your thoughts on this GitHub Issue if is a feature you feel strongly about).
You could record the time that the user is accessing the app by getting the current time and writing that value to a database. It looks like there are a few different ways to get the current time in Python, such as:
import datetime
current_time = datetime.datetime.now()
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.