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

Why not to paste GA4 code directly into HTML? #92

Open
vporton opened this issue Jan 5, 2025 · 0 comments
Open

Why not to paste GA4 code directly into HTML? #92

vporton opened this issue Jan 5, 2025 · 0 comments

Comments

@vporton
Copy link

vporton commented Jan 5, 2025

You didn't explain in your README file, why you recommend to use react-ga4, not just paste it into index.html of the React app. Your README file should contain such an explanation.

<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- Google tag (gtag.js) -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-PDPFZKZ3R6"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-PDPFZKZ3R6');
    </script>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width" />
    <title>Zon Social Network</title>
    <!--base href="/" /-->
    <link rel="icon" href="/favicon.ico" />
    <link type="text/css" rel="stylesheet" href="/main.css" />
  </head>
  <body>
    <div id="app"></div>
    <!-- Ybug code start (https://ybug.io) -->
  <script type='text/javascript'>
    (function() {
        window.ybug_settings = {"id":"r47mfh83w8m5091bscbk"};
        var ybug = document.createElement('script'); ybug.type = 'text/javascript'; ybug.async = true;
        ybug.src = 'https://widget.ybug.io/button/'+window.ybug_settings.id+'.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ybug, s);
    })();
  </script>
  <!-- Ybug code end -->
  </body>
</html>
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