blackcowmoo / grafana-google-analytics-datasource

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

Use the FilterExpression as a Dimmension filter in GA4 #78

Closed EugeneAc closed 1 year ago

EugeneAc commented 1 year ago

Since the FilterExpression is not used in GA4 requests, leverage it as a Dimension Filter (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#dimension_filters) such that the data can be filtered. This would require the string to be a Filter Expression object https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/FilterExpression

Example (taken from here - https://ga-dev-tools.google/ga4/query-explorer/): "filter":{ "fieldName":"searchTerm" "stringFilter":{ "matchType":"FULL_REGEXP" "value":"[a-zA-Z]{4,}" } }

lcc3108 commented 1 year ago

FiltersExpress is a field that exists in GA3. Adding only FiltersExpressions as dimensions filters is not appropriate because GA4 supports filters of more diverse fields.

lcc3108 commented 1 year ago

Processing in #90