escopecz / grav-ganalytics

Google Analytics plugin for Grav CMS
MIT License
20 stars 9 forks source link

Any plans on GA4? #29

Closed Karmalakas closed 1 year ago

Karmalakas commented 3 years ago

Planning to implement Google Analytics 4?

escopecz commented 3 years ago

I recently found out that I haven't check GA stats for several years and when I did I discovered I've never used this plugin I've created in my Grav based websites. So I'm thinking I won't spend time in this repository similarly like I should throw out the T-shirts I haven't wore for a year and use that space for stuff I use every day.

Want to be a maintainer?

Karmalakas commented 3 years ago

Let me get back to you on that in a few days, OK? :D My hands are full for now, but I'll still want to add GA, so might take the deal ;)

Coolguy3289 commented 2 years ago

Any updates on this? What about the changes made from #31 ?

Karmalakas commented 2 years ago

I'm still on old UA tracking and reviewed that PR. I just have no time now (and probably at least for a month more) to test it properly, but IMO this can't be merged.

Coolguy3289 commented 2 years ago

Well the author closed the PR right after...Lovely

Karmalakas commented 2 years ago

I saw Google announced deadline for UA, so I will still need to migrate, but not sure if it will be PR for this plugin or I will simply hardcode the snippet. Or maybe I'll just create a separate simple plugin 🤔 Have lots of work at my full-time job and other more important side projects 🙂

ViliusS commented 1 year ago

I'm interested in this too. @Karmalakas did you investigate what needs to be done to prepare for GA4? Is it just a different tracking snippet, or other settings, like 'anonimizeIp', needs to be adjusted too?

Since UA will be sunset on 1st of July 2023 I think it is safe to change the plugin to handle ONLY GA4 at this point.

Karmalakas commented 1 year ago

Sorry, didn't look into it yet, but as deadline approaches, i guess I'll have to at some point 😅

ViliusS commented 1 year ago

I went ahead and made a PR https://github.com/escopecz/grav-ganalytics/pull/34

Still need to add UA -> GA4 update documentation and there is a nasty bug in Grav with Plugin:saveConfig(), but more or less it should work. I have tried different cookie settings, renaming gtag object, the debug mode. The only thing I didn't test fully is opt-out mode.

Feel free to review and test.

ViliusS commented 1 year ago

UPDATE: added upgrade documentation to the PR.

The only issue to solve before PR can be merged is this Grav bug.

rodrigogiraoserrao commented 1 year ago

@ViliusS could your PR be merged even with the linked issue still open? The deadline for switching to GA4 is closing in and I don't mind doing a manual workaround to account for the linked issue. And I'm guessing others wouldn't mind, if that's what it takes for the Google Analytics plugin to have support for GA4.

ViliusS commented 1 year ago

@rodrigogiraoserrao yeah, I think it is better to have a working version with a documented known issue, than no version at all. I have pinged the author of this plugin to merge PR.

escopecz commented 1 year ago

Thanks folks! Merged.

rodrigogiraoserrao commented 1 year ago

Thanks @escopecz! How do we get this in the grav plugins? You need to do a release, no?

escopecz commented 1 year ago

Yep. @ViliusS can you please check if you have permission to tag and release now?

ViliusS commented 1 year ago

@escopecz Thank you! Version 2.0.0 is now released and already synched with Grav servers.

If anyone finds issues with GA4 support, please open separate ticket for that.

rodrigogiraoserrao commented 1 year ago

Brilliant! Thank you both 😃