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

Google analytics is enabled for site previews #133

Closed
chalin opened this issue Jul 21, 2022 · 2 comments
Closed

Google analytics is enabled for site previews #133

chalin opened this issue Jul 21, 2022 · 2 comments

Comments

@chalin
Copy link

chalin commented Jul 21, 2022

Google analytics should be enabled for the production server only. It's current active for site previews as well.

For example, see the page source for the homepage of this preview, https://deploy-preview-130--containerd-io.netlify.app:

<!DOCTYPE html>
<html lang="en-us">
  <head>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

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

  gtag('config', 'UA-117325385-1');
</script></head>

  <body class="page is-home-page has-navbar-fixed-top">
  </body>
</html>

Related:

/cc @nate-double-u

@chalin
Copy link
Author

chalin commented Jul 22, 2022

/assign @chalin - I have a solution to this issue that builds upon #135, which I'll submit once #135 is merged.

@chalin
Copy link
Author

chalin commented Nov 11, 2022

To be addressed via #147.

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