444B / streamlit-analytics2

👀 Track & visualize user interactions with your streamlit app
MIT License
14 stars 2 forks source link

[BUG] streamlit-analytics cannot track multi-page separately #47

Open Joyce920hope opened 4 months ago

Joyce920hope commented 4 months ago

I have 2 pages in my application, and I'm tracking both the page views and st.sidebar.file_uploader for each page. On page1, the number of page_view and the number of uploaded_file is only for page 1, which is as expected. However for page2, the number of page_view and the number of uploaded_file are not only of page2, but also combined with these two metrics of page1. Any idea why that maybe happening? Thank you.

444B commented 4 months ago

@Joyce920hope Thank you for raising this issue! I believe this is is within the current limitations of streamlit_analytics2

Can you try add a tracking to the other pages and let me know if that works? I think it might since it will still increment session state

444B commented 4 months ago

Oh hang on, I understand that you want to see the metrics for each page separately... Yes, that would be happening since both calls to streamlit_analytics on each page is going to contribute to the session state as a whole.

Joyce920hope commented 3 months ago

@444B Yeah, I believe this is the limitation of the package. Thanks for your explanation. And thank you for taking the action! If you got any update on the issue, please let me know!

444B commented 2 weeks ago

Related issue #100

alon-sht commented 6 days ago

Do you belive this issue will be solved sometimes soon? This would be awesome I tried playing with it by calling reset_counts() within strart_tracking() This indeed sepeareted the info from the pages, but it resets the counts every refresh...