Skip to content

Commit c5011bf

Browse files
author
Adriano Sanges
committed
Integrate Streamlit Analytics for enhanced user tracking and analytics
- Added `streamlit-analytics` dependency to track user interactions within the app. - Implemented tracking start and stop functions in `main.py` to monitor user activity during session. - Updated `pyproject.toml` and `uv.lock` to include the new analytics package and its specifications.
1 parent 6464f9a commit c5011bf

File tree

3 files changed

+196
-2
lines changed

3 files changed

+196
-2
lines changed

main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import folium
77
import streamlit_folium as st_folium
88
import os
9-
9+
import streamlit_analytics
1010
# Set page configuration as the first Streamlit command
1111
st.set_page_config(layout="wide", page_title="Interactive Real Estate Map", page_icon="🌍")
1212

@@ -56,6 +56,8 @@ def main():
5656
conn = duckdb.connect(database="dati-immobiliari.duckdb")
5757
init_db(conn)
5858

59+
streamlit_analytics.start_tracking()
60+
5961
tableTab, mapTab = st.tabs(["Table", "Map"])
6062

6163
with tableTab:
@@ -103,6 +105,8 @@ def main():
103105
with mapTab:
104106
pass
105107

108+
streamlit_analytics.stop_tracking()
109+
106110
except Exception as e:
107111
st.error(f"An error occurred: {e}")
108112
return 1

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ dependencies = [
99
"streamlit-folium>=0.23.2",
1010
"streamlit>=1.40.2",
1111
"geopandas>=1.0.1",
12+
"streamlit-analytics>=0.4.1",
1213
]

uv.lock

Lines changed: 190 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)