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

Migrate to Google Analytics 4 (GA4) #5382

Closed
3 tasks done
chalin opened this issue Nov 12, 2022 · 9 comments
Closed
3 tasks done

Migrate to Google Analytics 4 (GA4) #5382

chalin opened this issue Nov 12, 2022 · 9 comments
Labels

Comments

@chalin
Copy link
Contributor

chalin commented Nov 12, 2022

This issue is part of a CNCF-wide effort to upgrade project websites to GA4 since Google has deprecated Universal Analytics (UA). For more details, see:

Tasks: stage 1, 2 & 3 (no code or config changes necessary)

  • Create a GA4 site tag under the CNCF projects account.
    The new GA4 stream measurement ID is: G-JNBNV64PDX
  • Configure GA4 website ID (gtag.js) through Netlify snippet injection, "Google Analytics 4 - only in production", just before </head>:
    {% if CONTEXT == 'production' %}
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-JNBNV64PDX"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
    
      gtag('config', 'G-JNBNV64PDX');
    </script>
    {% endif %}
  • Confirm that the GA4 site tag is receiving events

Followup

  • Confirm that the UA site tag is still receiving events -- CNCF doesn't have access to the UA analytics account, but there have been no code changes, so the site tag should still be receiving events.
  • Google Analytics 4 migration followup #5384

Pre-migration analytics info for the website

  • UA ID UA-84550302-1 is registered via the old analytics.js
  • Site built with Hugo 0.88.x
  • Hosted on Netlify

/cc @caniszczyk @nate-double-u

@chalin
Copy link
Contributor Author

chalin commented Nov 12, 2022

Hello maintainers: I can't seem to find the Netlify account under the sites accessible to the CNCF. Can you grant me access (my GitHub ID at cncf.io) to:

  • OPA's Netlify account
  • Google Analytics account for UA ID UA-84550302-1

@srenatus
Copy link
Contributor

Heya! I'm happy to help set you up.

What I don't quite understand is the need to access OPA's Netlify account. The website is built from any merged pull request, and the GA stuff is no exception:

https://github.com/open-policy-agent/opa/blob/main/docs/website/layouts/partials/google-analytics.html#L3

@srenatus
Copy link
Contributor

✔️ Went ahead and sent you an invite to the netlify site:
image

@chalin
Copy link
Contributor Author

chalin commented Nov 14, 2022

What I don't quite understand is the need to access OPA's Netlify account.

Thanks for access to the Netlify account @srenatus. Now that I've assessed the situation, I can confirm that the simplest way to upgrade to GA4 for the OPA website, is to use Netlify snippet injection. For task details, see the opening comment.

Can you also grant me access to the Google Analytics for the UA property UA-84550302-1? This isn't strictly necessary, but it will allow me to cross-check some of the cleanup tasks.

@srenatus
Copy link
Contributor

@peteroneilljr could you please do that GA user thing? I'm pretty illiterate when it comes to GA... 😳

@chalin
Copy link
Contributor Author

chalin commented Nov 14, 2022

GA4 setup is complete, so I'll close this issue. We'll track cleanup tasks via:

@chalin chalin closed this as completed Nov 14, 2022
@srenatus
Copy link
Contributor

For future reference, this

image

caused this:

image

@chalin
Copy link
Contributor Author

chalin commented Feb 20, 2023

@peteroneilljr could you please do that GA user thing? I'm pretty illiterate when it comes to GA... 😳

@peteroneilljr @srenatus - I still need access to the old GA account; or, if you have access you need to opt out of Google's automatic creation of a new GA4 site tag, since we have one already.

@chalin
Copy link
Contributor Author

chalin commented Feb 20, 2023

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

No branches or pull requests

2 participants