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] Handle passing variables to Dimension Filter #97

Open elanon1 opened 1 year ago

elanon1 commented 1 year ago

I think it is not possible to pass variables to Dimension Filter value currently, are there any plans to add this feature?

NithyaMenon commented 1 year ago

+1 from me, was just about to log this feature request.

lcc3108 commented 1 year ago

I think it's right, but do you think it's right that you want to use the Variable below?

image

Link for myself https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/add-support-for-variables#interpolate-variables-in-data-source-plugins

pebg-cmonetiquette commented 11 months ago

+1 It would help me to have this feature

fokion commented 4 months ago

any updates on this? Do you need help working on this?

lcc3108 commented 4 months ago

We have done some work on the dimension filter at the moment.

Additional work is always welcome.

RubenSGoosen commented 2 months ago

+1 Having an issue with passing variable to dimensionFilter. Using IN_LIST filter type. As they are string separated, I pass my variable "var" as such: ${var:csv}. The expected json payload should look something like:

dimensionFilter:Object orGroup:Object expressions:Array[1] 0:Object filter:Object fieldName:"campaignName" filterType:"IN_LIST" inListFilter:Object caseSensitive:true values:Array[2] 0:"xxxx" 1:"yyyy"

It appears that, passing a variable to dimensionFilter handles the entire variable as a single string - It simply does not pickup the comma separators. Below is the json payload that is returned:

dimensionFilter:Object orGroup:Object expressions:Array[1] 0:Object filter:Object fieldName:"campaignName" filterType:"IN_LIST" inListFilter:Object caseSensitive:true values:Array[1] 0:"xxxx, yyyy"

lcc3108 commented 1 month ago

+1 Having an issue with passing variable to dimensionFilter. Using IN_LIST filter type. As they are string separated, I pass my variable "var" as such: ${var:csv}. The expected json payload should look something like:

dimensionFilter:Object orGroup:Object expressions:Array[1] 0:Object filter:Object fieldName:"campaignName" filterType:"IN_LIST" inListFilter:Object caseSensitive:true values:Array[2] 0:"xxxx" 1:"yyyy"

It appears that, passing a variable to dimensionFilter handles the entire variable as a single string - It simply does not pickup the comma separators. Below is the json payload that is returned:

dimensionFilter:Object orGroup:Object expressions:Array[1] 0:Object filter:Object fieldName:"campaignName" filterType:"IN_LIST" inListFilter:Object caseSensitive:true values:Array[1] 0:"xxxx, yyyy"

@RubenSGoosen

I tested it and it's a bug. I didn't consider the array in replacing the variable

Until it's resolved,Maybe using ${var:regex} in the string filter full_regex will have the same effect.(Test is required.)