ckan / ckanext-googleanalytics

CKAN extension to integrate Google Analytics data into CKAN. Gives download stats on package pages, list of most popular packages, etc.
GNU Affero General Public License v3.0
35 stars 80 forks source link

Switching to Google Analytics 4? #69

Open mmdolbow opened 1 year ago

mmdolbow commented 1 year ago

Google Analytics 4 was introduced within the last few years, and I'm curious if any work has been done on this extension to enable a migration to a GA4 property. It appears that it's only set up for the old "Universal Analytics" but I'm a bit out of my depth so hoping this is a quick answer.

smotornyuk commented 1 year ago

We started working on it but not much was done. If the only thing you need is sending request details to GA, switch to tag v2.1.1(or pip install ckanext-googleanalytics[requirements]==2.1.1 and use the G-* tracking code from GA4 instead of UA-*. It will automatically switch to a different JS for tracking, and that's it. You should see page visits in the GA console from this moment.

mmdolbow commented 1 year ago

Thank you for the advice; sending the details to GA is likely going to be good enough for me - we don't have / need a ton of customization. I will give this a shot, much appreciated!

MarkCalvert commented 1 year ago

Hi @smotornyuk,

Is there any update on upgrading to Google Analytics 4 (GA4)? Currently, the Statistics Retrieval from Google Analytics feature will not work for GA4 because it needs to be upgraded to use the new Google Analytics Data API (GA4) with the python package Python Client for Analytics Data API This is quite urgent with the pending deadline of Universal Analytics (UA) standard stopping processing data on the 1 July 2023 Universal Analytics is going away

smotornyuk commented 1 year ago

Hi, @MarkCalvert

No, I haven't done anything for statistics retrieval yet and I won't have a chance to work on it during the next couple of months.

MarkCalvert commented 1 year ago

@smotornyuk Okay, we will work on updating the one functionality we need right now for one of our projects which is getting the raw data from GA4 data API in the CLI load command.