blackcowmoo / grafana-google-analytics-datasource

Grafana Google Analytics datasource
https://grafana.com/grafana/plugins/blackcowmoo-googleanalytics-datasource/
Apache License 2.0
37 stars 16 forks source link

[FEATURE] Add support for google analytics v4 #54

Closed kahnwong closed 1 year ago

kahnwong commented 2 years ago

Google analytics v3 is sunsetting around middle of next year, which means current implementation (google analytics v3) would be obsolete soon.

Mehdi-YC commented 2 years ago

Hello , is this WIP or not yet ?

lcc3108 commented 2 years ago

Not yet. I think we can proceed after supporting Grafana 9 version and updating READEME.md for setting

ZachBurm commented 1 year ago

hey, @lcc3108 curious about the eta on this? Would like to see support in Grafana > 9

rushalexander commented 1 year ago

Guys, this summer, on July 1, 2023, standard Universal Analytics properties will stop processing data. Can we hope for new version of plugin with GA4 support before this?

lcc3108 commented 1 year ago

No api has been officially released for the new ga4. (beta or alpha status)

I'm going to try with an api in beta or alpha. However, I don't know if I can do it before July 01.

aa-matthias commented 1 year ago

Is support for Event Scope Custom Metrics present already / can it be added? I cannot find it in the metrics picker

image

lcc3108 commented 1 year ago

Currently, I have written a code for GA4 support on the master branch and will support GA4 in release 0.2.0.

Plugin 0.2.0 has been submitted to Grafana and is awaiting confirmation of Grafana.

aa-matthias commented 1 year ago

Hi @lcc3108 - thanks for your work towards GA4 support! We're using 0.2.0 already.

It's working fine for the out of the box metrics - however within the updated ui for choosing metrics / dimensions in the query builder I cannot find the averageCustomEvent:page_load_time which is visible via the Metric Browser

https://ga-dev-tools.google/ga4/dimensions-metrics-explorer/

lcc3108 commented 1 year ago

@aa-matthias I think we need to check.

Maybe if it doesn't come out of the 0.2.0 plug-in, it should be released as a new feature. customDimension and customMetrics create and test it

aa-matthias commented 1 year ago

Hi @lcc3108 - i tried fetching the property metadata from analyticsdata api and custom dimensions / metrics are part of the result set. however i cannot select / find them in the field picker currently. here is the response:

{
  "apiName": "customEvent:add_to_cart_quickbuy",
  "uiName": "add_to_cart_quickbuy",
  "description": "An event scoped custom dimension for your Analytics property.",
  "customDefinition": true,
  "category": "Event-scoped Custom Dimension"
},
{
  "apiName": "customEvent:allow_linker",
  "uiName": "allow_linker",
  "description": "An event scoped custom dimension for your Analytics property.",
  "customDefinition": true,
  "category": "Event-scoped Custom Dimension"
},

For other fields Searching Dimensions works sometimes (e.g. for "Virtual currency name") if I search for "virtual" it works, if i search for "Virtual cur" no dimension is found.

lcc3108 commented 1 year ago

@aa-matthias Can't find custom dimension metrics in grafana query page? custom dimensions/metric will be added to 0.2.1 and I will work on it this weekend.

If the problem occurred on the ga-dev-tools page I don't know because https://ga-dev-tools.google/ga4/dimensions-metrics-explorer is managed by Google.

For other fields Searching Dimensions works sometimes (e.g. for "Virtual currency name") if I search for "virtual" it works, if i search for "Virtual cur" no dimension is found.

The search function uses the front-end components of Grafana.

Additionally, the selector uses id, uiName, and description, but it seems that it can be searched only by api name.

Let me check if there is anything to improve on this as well.

lcc3108 commented 1 year ago

The plugin was submitted to Grafana on June 17th for review.

I received a reply today that the plugin reviewing was delayed. Grafana said they would proceed with ASAP.

aa-matthias commented 1 year ago

Hi @lcc3108 - I can't find them via grafana query page - I can find them in metrics explorer by google and when calling the api directly.

Sounds great - thanks for your support with that - I'll try out the updated version when available!