@Marc apparently you can add it in an iframe without editing the index.html page.

  
    
    
    How to add Google Analytics or JS code in a Streamlit app? Using Streamlit
  
  
    With streamlit 0.75+, you can add google analytics directly in the script file using components iframe. You can check my example here: COVID-19/app.py at master · QuocTran/COVID-19 · GitHub No need to change static file index.html .