openequella / openEQUELLA

Core openEQUELLA sources
https://openequella.github.io/
Apache License 2.0
42 stars 44 forks source link

Google Analytics 4 support #4621

Closed phette23 closed 1 year ago

phette23 commented 1 year ago

Is your feature request related to a problem? Please describe.

Google is sunsetting Universal Analytics and existing UA properties will no longer collect data starting this summer. openEQUELLA only supports UA (at least according to the documentation examples).

Describe the solution you'd like

Provide a new setting, analogous to the current UA one, which accepts a GA4 property ID and inserts the corresponding script tag on every page.

Describe alternatives you've considered

Because openEQUELLA doesn't support injecting custom JavaScript on every page (e.g. as part of the theme), it's not easy to roll your own analytics. You could inject it in various places with Freemarker templates (item display templates, power search descriptions, dashboard portlets, etc.) but you'd still miss some places, plus it'd be extremely tedious to cover everywhere.

The obvious alternative is to sneak a <script> tag in a language pack property for a string that's on every page, like the ones in the footer. Using language packs for code is pretty hacky and not ideal.

Additional context

https://support.google.com/analytics/answer/10759417?hl=en

Google has a ton of documentation on migrating to GA4. The code in the script tag changes, which is why I don't think it's as easy as swapping a GA4 property ID for a UA one.

edalex-ian commented 1 year ago

Hello @phette23

Thanks for raising the issue. I believe we do having some work planned around this. We'll be sure to mention it when available.

edalex-ian commented 1 year ago

Hello @phette23

This work has been completed and is currently available on the develop branch. As a result it will be released as part of 2023.1 later this year.