-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add google analytics #182
add google analytics #182
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
<Script | ||
id='google-analytics-script' | ||
strategy='afterInteractive' | ||
src={`https://www.googletagmanager.com/gtag/js?id=${process.env.GOOGLE_ANALYTICS_ID}`} | ||
/> | ||
|
||
<Script | ||
id='google-analytics-init' | ||
strategy='afterInteractive' | ||
dangerouslySetInnerHTML={{ | ||
__html: ` | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){ dataLayer.push(arguments); } | ||
gtag('js', new Date()); | ||
gtag('config', '${process.env.GOOGLE_ANALYTICS_ID}'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to use the config variable GOOGLE_ANALYTICS_ID
rather than pulling directly from the environment?
https://github.com/OperationSpark/operationspark-org-website-2022/pull/182/files#diff-b185de5824bdea4abb07f31f230b6067b589a4fd64f56660590a68c24243f213R2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved all client environment variables to clientConfig
f416b0b
I'm not 100% sure if this will work as expected. I think that will become clear pretty quickly once deployed to check if we are seeing the information we want