OnroerendErfgoed / atramhasis

An online SKOS editor
http://atramhasis.readthedocs.io/
GNU General Public License v3.0
52 stars 11 forks source link

Re-evaluate Google Analytics #738

Closed JonasGe closed 1 year ago

JonasGe commented 1 year ago

We have removed the Google Analytics macro from pyoes 0.16.0.

Upgrading pyoes will break current code so we have to determine whether we want to completely remove GA tracking or implement something different (like Plausible).

koenedaele commented 1 year ago

Good catch. Although core Atramhasis does not depend on pyOEs, it does probably use a similar macro.The current codebase treats a ga tracker in a special way, but it's possible to supply other tracking codes, see https://atramhasis.readthedocs.io/en/latest/customisation.html#adding-google-analytics The ga macro that's include will be outdated soon as well, since it was written for universal analytics which is going to be removed soon. So, I'd remove the macro and just explain in the docs how you could add your own tracker, using Plausible as an example.

JonasGe commented 1 year ago

I propose allowing full flexibility by replacing the ga_tracking macro with a generic insert_tracking_snippet macro. I have done a similar thing here: https://github.com/OnroerendErfgoed/oe-sphinx-theme/blob/master/oe_sphinx_theme/theme/oe_sphinx/layout.html#L11-L13 It works well for Plausible analytics but I have yet to test it with the more complex GA tracking snippet.

I'll write the code to test whether jinja handles inserting complex JS snippets well and open a pull request.