Adding Google Analytics Tag


I have finished and deployed my streamlit project on google cloud.
Is there a simple way to add the lines below to my py file?

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src=" code"></script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'tracking code');

Hi @ozgurdugmeci !

Have a look at this answer, it presents a quick workaround while the dev team thinks about the issue :slight_smile:


1 Like