Search code examples
phpwebgoogle-analytics-api

Google Analytics Metro Filter Billings MT


In my options array I am trying to filter on the metro area "Billings MT" using 'filters'=>'ga:metro==Billings, MT'.

However it comes back with the error "code":400,"message":"Invalid value 'ga:metro==Billings, MT' for filters parameter."

I've tried 'filters'=>'ga:metro==Billings MT' but that doesn't return results.

From the analytics dashboard on analytics.google.com the metro name is "Billings, MT"

Has anyone else run into this problem?


Solution

  • I think it because of comma.

    Try escaping it like 'ga:metro==Billings\, MT'. It should work.