Google analytics #1800
NanoscaleSimulations
announced in
Q&A
Replies: 1 comment
-
Hey @NanoscaleSimulations, you should be able to do this by inserting the def index():
return container(
rx.script(
src="https://www.googletagmanager.com/gtag/js?id=<TAG>",
strategy="afterInteractive",
),
rx.script(
"""
window.dataLayer = window.dataLayer || [];
function gtag(){window.dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', <TAG>);
""",
id="google-analytics",
strategy="afterInteractive",
),
# Rest of the page contents here
) You would have to add this to every page, but you can abstract it out into a template that you apply to all your pages. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Anyone succesfully set up google analytics for their reflex app/website?
Or does anyone know how to do it?
Or is there another way to track visitors and interactions?
Thanx in advance :)
Beta Was this translation helpful? Give feedback.
All reactions