Skip to content
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

Implement Google Analytics #17

Closed
CrocoDillon opened this issue Mar 23, 2018 · 2 comments
Closed

Implement Google Analytics #17

CrocoDillon opened this issue Mar 23, 2018 · 2 comments

Comments

@CrocoDillon
Copy link
Owner

Article might be outdated but something like https://www.themarketingtechnologist.co/setting-up-a-cookie-law-compliant-google-analytics-tracker/

So we don't need to bother users with a cookie notification.

@CrocoDillon
Copy link
Owner Author

CrocoDillon commented Apr 4, 2018

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-38025571-3"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-38025571-3');
</script>

Need to figure out how to use with SPAs (I can imagine that needs some extra work to register page loads).

EDIT Doesn't seem to be that hard: https://developers.google.com/analytics/devguides/collection/gtagjs/single-page-applications

@CrocoDillon
Copy link
Owner Author

Man, I love Next... vercel/next.js#4036

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant