I am querying the google analytics API and get an error response saying:
Selected dimensions and metrics cannot be queried together.
Using the dimensions-metrics-explorer I can find which dimensions and metrics can be queried together. https://ga-dev-tools.appspot.com/dimensions-metrics-explorer/
The dimension and metric I want to combine should be possible according to the explorer (CM Impressions and CM Campaign (CM Model))
However, if I tick the box Only show fields that are allowed in segments
both those options disappear. So I assume that I am using segments in my request but I do not understand if I truly do or what a segment is.
These are the parts of my query:
auth: <auth>,
'max-results': 10000,
quotaUser: <quotaUserId>,
metrics: [ 'ga:dcmImpressions' ],
dimensions: [ 'ga:dcmLastEventCampaign', 'ga:date' ],
'start-date': <rangeStart>,
'end-date': <rangeEnd>,
id: [ <analyticsViewIds> ],
Am I using segments and if so, what is the segment?