blackcowmoo / grafana-google-analytics-datasource

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

[FEATURE] Support custom metrics and dimensions #70

Closed lcc3108 closed 1 year ago

lcc3108 commented 1 year ago

Is your feature request related to a problem? Please describe. https://github.com/blackcowmoo/grafana-google-analytics-datasource/issues/54#issuecomment-1597157310 Is support for Event Scope Custom Metrics present already / can it be added? I cannot find it in the metrics picker

image

Originally posted by @aa-matthias in https://github.com/blackcowmoo/grafana-google-analytics-datasource/issues/54#issuecomment-1597157310

Describe the solution you'd like Get metrics with propertyId

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

lcc3108 commented 1 year ago

@aa-matthias I checked that custom metrics and dimensions currently working.

However, it was not sufficiently tested in UA and GA. If you want to test it first, use the following branch

69 or branch feature/backend/support-custom-metric-dimension

aa-matthias commented 1 year ago

Hi @lcc3108 - i would be happy to test, but it looks like the CI Action is not storing the Artefacts of the build job. Is it possible to get a plugin.zip of the package? Thanks!

lcc3108 commented 1 year ago

https://github.com/blackcowmoo/grafana-google-analytics-datasource/tree/feature/backend/support-custom-metric-dimension/build you can try docker build 0.2.1 will be combined with additional features and will be created as a release.

aa-matthias commented 1 year ago

@lcc3108 do you know when Release 0.2.1 will be published in the grafana Plugin Marketplace?

lcc3108 commented 1 year ago

@aa-matthias Commutiny plugin are released only with Grafana approval.

Currently awaiting review of the grafana.


I submitted a plugin update request at 08/24 11:50PM KST and currently awaiting review.

aa-matthias commented 1 year ago

thanks, ok

lcc3108 commented 1 year ago

0.2.1 released

aa-matthias commented 1 year ago

Checking out Release 0.2.2 I can now pick Custom Metrics in the Query Builder 🚀 - returned values are null but same query works in GA4 Query Explorer

image

this seems to be a type config issue based on the warnings i get

image

image

lcc3108 commented 1 year ago

@aa-matthias I will create a new issue based on what you reported.

Additionally, could you give me a brief explanation or a link so that I can set the custom metric the same?

aa-matthias commented 1 year ago

Sure - custom metrics need to be defined within the GA4 propery. RunReportResponse will then include information about the data type of the custom metric. Possible types can be seen in the docs:

https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/MetricType?hl=en

I would say the type needs to be considered when interpreting / transforming the response - looks like currently the grafana-google-analytics-datasource plugin tries to interpret the values as datetime fields.

in our case the metric is of type TYPE_MILLISECONDS