Согласно Google Analytics, в раздел HTML необходимо добавить следующее.
Код: Выделить всё
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-**********');
Код: Выделить всё
google_analytics_js = '[previous_html_code]'
st.components.v1.html(google_analytics_js)
Подробнее здесь: https://stackoverflow.com/questions/705 ... -streamlit