Spaces:
Running
Running
miaohaiyuan
commited on
Commit
·
422bdb2
1
Parent(s):
2b7833d
add GA tag
Browse files
app.py
CHANGED
@@ -7,6 +7,24 @@ from groq import Groq
|
|
7 |
st.set_page_config(page_icon="💬", layout="wide", page_title="Groq Chat Bot...")
|
8 |
|
9 |
_ = load_dotenv(find_dotenv())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
def icon(emoji: str):
|
12 |
"""Shows an emoji as a Notion-style page icon."""
|
|
|
7 |
st.set_page_config(page_icon="💬", layout="wide", page_title="Groq Chat Bot...")
|
8 |
|
9 |
_ = load_dotenv(find_dotenv())
|
10 |
+
GA_TRACKING_ID = os.environ['GA_TRACKING_ID']
|
11 |
+
|
12 |
+
# insert Google Analytics
|
13 |
+
st.components.v1.html(
|
14 |
+
f"""
|
15 |
+
<!-- Global site tag (gtag.js) - Google Analytics -->
|
16 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id={GA_TRACKING_ID}"></script>
|
17 |
+
<script>
|
18 |
+
window.dataLayer = window.dataLayer || [];
|
19 |
+
function gtag(){{dataLayer.push(arguments);}}
|
20 |
+
gtag('js', new Date());
|
21 |
+
|
22 |
+
gtag('config', '{GA_TRACKING_ID}');
|
23 |
+
</script>
|
24 |
+
""",
|
25 |
+
height=0,
|
26 |
+
width=0,
|
27 |
+
)
|
28 |
|
29 |
def icon(emoji: str):
|
30 |
"""Shows an emoji as a Notion-style page icon."""
|