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?
Am I using segments?
No, you're making a regular query
what is the segment?
Segments are a special data querying feature:
not
option, allowing you to compare to mutually exclusive segments of user (eg compare users who performed a goal vs users who didn't to understand what gets people to convert)Deciding whether to use segments per se is pretty simply:
The challenging part is knowing what you need to query:
Business side
: being able to formulate a hypothesis that makes senseGA side
: being able to translate that into a query, which implies an understanding of the scopes