File size: 668 Bytes
48696aa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import streamlit as st
import streamlit.components.v1 as components

def ga_markdown():
    # Add Google Analytics code to the header
    html_string = """
        <!-- Global site tag (gtag.js) - Google Analytics -->
        <script async src="https://www.googletagmanager.com/gtag/js?id=G-RGME574XZF"></script>
        <script>
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());
            gtag('config', 'G-RGME574XZF');
            console.log('gtag')
        </script>
        """
    components.html(html_string)
    st.markdown(html_string, unsafe_allow_html=True)