Reputation: 23
I can easily set custom dimensions in Google Analytics as
ga('set', 'dimension2', '100');
The data can be seen in Analytics also. But I cannot use filter by the custom dimension while querying via Google Analytics API like
'filters'=>'ga:dimension2==100'
The error says :
"message":"Unknown dimension(s): ga:dimension2\nFor details see https://developers.google.com/analytics/devguides/reporting/core/dimsmets."}],"code":400,"message":"Unknown dimension(s): ga:dimension2\nFor details see https://developers.google.com/analytics/devguides/reporting/core/dimsmets."}}
Please help me to query analytics with filter by custom dimension.
Upvotes: 0
Views: 666
Reputation: 13
Custom Dimensions are defined at the web property level, is it possible you are querying that filter on a view that does not belong under the web property you defined the dimension under?
You can also double check that you are using the correct dimension id with the Management API.
Upvotes: 1