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) #273

Closed
5 tasks done
chalin opened this issue Sep 29, 2022 · 11 comments
Closed
5 tasks done

Migrate to Google Analytics 4 (GA4) #273

chalin opened this issue Sep 29, 2022 · 11 comments

Comments

@chalin
Copy link
Contributor

chalin commented Sep 29, 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: stages 1, 2 & 3

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

/cc @caniszczyk @nate-double-u


Completed tasks

Tasks: prep

I'm noticing that UA GA was added via:

and that despite all the source files still being present, I'm not seeing any evidence of the UA-148359966-1 site tag being used in any of the ep.io pages. Might analytics have been inadvertently removed?

I've raised a separate issue for this:

@phlax
Copy link
Member

phlax commented Sep 29, 2022

Might analytics have been inadvertently removed?

i have asked in the past about getting access to the analytics as it would be helpful in understanding any issues with the website (eg heavy traffic)

cc @mattklein123

@chalin
Copy link
Contributor Author

chalin commented Sep 29, 2022

I'd like to request access to the analytics too.

@mattklein123
Copy link
Member

I think I have access to the Analytics and can probably figure out how to give it out. Please ping me on Envoy slack.

@chalin
Copy link
Contributor Author

chalin commented Sep 29, 2022

Thanks @mattklein123. I just pinged you from the CNCF slack workspace.

@chalin
Copy link
Contributor Author

chalin commented Sep 29, 2022

Analytics are back!

$ curl -i https://www.envoyproxy.io/ 2>/dev/null | grep UA-1
  ga('create', 'UA-148359966-1', 'auto');

All we need now is to have access to the analytics console :).

@richarddli or @alyssawilk might you have access to the Envoy website's Google Analytics console?

I'm still waiting on feedback from @caniszczyk. If Chris and no one else have access, then (as @mattklein123 suggested), I'll simply create a new GA4 site tag and we'll use it instead.

@chalin
Copy link
Contributor Author

chalin commented Sep 29, 2022

As @phlax points out just above this #274 (comment), there's no GA associated with the docs, since they are generated separately. @phlax's suggestion of using Netlify snippet injection would be a clean and simple solution to get analytics into all of the site pages.

@chalin
Copy link
Contributor Author

chalin commented Sep 29, 2022

Oh, I remember now why we have moved away from snippet injection for another project. As far as I recall, snippet injection is applied to all builds, not just production builds. Maybe that's configurable? I'll take another / closer look tomorrow.

@phlax
Copy link
Member

phlax commented Sep 29, 2022

its also not as configurable - but the alternative is manually injecting the snippet into historical pages and adding the snippet to new docs builds - doable but probs not the easiest way

@chalin
Copy link
Contributor Author

chalin commented Sep 30, 2022

  • Oh, snippets are actually nicely configurable. I'll work on something today.
  • I'm going ahead and creating the GA4 site tag, which we'll need regardless if we ever gain access to the UA property.

/assign @chalin

@chalin
Copy link
Contributor Author

chalin commented Sep 30, 2022

Production-only snippet injection has been enabled, and I've checked a branch deploy to ensure that it isn't getting any dynamic snippet injection.

The GA4 site tag is processing events:

image

@chalin
Copy link
Contributor Author

chalin commented Sep 30, 2022

Whether we ever recover the UA access, the work here is done. Closing.

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

3 participants