Projects can set a tracking_id
tag if the google_analytics
feature is enabled for the neighborhood. Doing this automatically includes the analytics.js snippet and initializes it with the project's tag on all project pages. Nifty feature.
However, this is all using Google's now fully deprecated Universal Analytics. UA will be fully shutdown and deleted as of July 2024. It has been replaced by its successor Google Analytics 4 (GA4).
It appears that for some time now (and for an indeterminate amount of time into the future) Google has been forwarding all UA traffic to GA4 behind the scenes. So all existing UA tags and snippets out in the wild will continue to function. This means that all projects that already have tracking_id
s set will continue to work as expected for the foreseeable future.
However #2, It is unknown whether this flow will work for new GA4 tags. For example if a new project wants to add new analytics, they will only have a GA4 tag. Will the existing UA snippet flow work with that tag?
So for that reason and for the reason that GA4 has all sorts of fancy new features, it would be nice if we officially supported it going forward.
Other things to consider:
* Update the documentation to mention extending/overriding the custom_tracking_js
macro in a custom theme for further analytics collection customization.