Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Analytics: Invalid value for filters parameter

What are valid parameters for google analytics filters? I have looked on https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters and trying to get info for custom ga:campaign and ga:adContent

query: {
'ids': IDS,
'dimensions': 'ga:date',
'metrics': 'ga:pageviews, ga:sessions',
'filters' : 'ga:source%3D%3Dfacebook;ga:campaign%3D%3Dmycampaing;ga:adContent%3D%3Dtest'
},

Query fails with the error:

"Invalid value 'ga:source%3D%3Dfacebook;ga:campaign%3D%3Dmycampaing;ga:adContent%3D%3Dtest' for filters parameter."

How can I get report from google analytics for my ga:campaign and etc?

like image 773
Elvira Avatar asked Mar 23 '16 10:03

Elvira


1 Answers

When I feed the same combination of filters, dimensions and metrics to the query explorer I get no error message but a result (with all metrics being 0 because obviously my campaigns are named differently, but otherwise fine).

Only difference is that I did not encode the filters - I think if you use the API client it takes care of url encoding, so try and use "==" instead of "%3D%3D" and this should work fine.

like image 176
Eike Pierstorff Avatar answered Nov 16 '22 11:11

Eike Pierstorff