444B / streamlit-analytics2

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

track with conditions #28

Closed 444B closed 4 months ago

444B commented 4 months ago

Original issue by abobafett-dev on 2022-11-17 12:38:49+00:00

Hello, I have student project where I use your package. And I want to track information in if construction with elements which I create before that. Can I track information in same elements which I track information before use if or custom element.

Something like: in code:

with streamlit_analytics.track():
    options = streamlit.multiselect(
        'Choose your color:',
        [
            '🔴',
            '🟡',
            '🔵',
            '🟢',
            '🟣'
        ],
    button = streamlit.button('activate_button')
if button:
    streamlit_analytics.custom_track(name_of_element='activate_button')
    streamlit_analytics.custom_track(name_of_element='count_of_using_main_feature')

current result after choose 🔴 and 🟡 colors and click on button:

{
    'Choose your color:'
    {
        '🔴': 3
        '🟡': 2
        '🔵': 0
        '🟢': 0
        '🟣': 0
    }
    'activate_button': 1
}

what I want to see:

{
    'Choose your color:'
    {
        '🔴': 3
        '🟡': 2
        '🔵': 0
        '🟢': 0
        '🟣': 0
    }
    'activate_button': 2
    'count_of_using_main_feature': 1
}

Can you help me with that?

By the way, there is another point here. I think that bad if the checkbox has the value False, then it is tracking. And the fact that if I select elements in multiselect, it's all tracking sequentially as in the example above.

444B commented 4 months ago

@abobafett-dev is this still relevant?

abobafett-dev commented 4 months ago

@abobafett-dev is this still relevant?

Not for me

444B commented 4 months ago

Thanks for the reponse! I am closing this issue