-
Google Analytics API: Request Error – Incompatible Dimensions and Metrics
Hey there, I was using this custom dimension in Google Analytics Data API v1Beta to pull data from our GA4 account, and until yesterday things were working fine. But now I’m seeing this error saying I need to remove ‘customEvent:institution_id’ to make the request compatible. Any clue why this is happening? It seems like there’s some issue with the request’s dimensions & metrics. There’s more info about this at this link: https://ga-dev-tools.web.app/ga4/dimensions-metrics-explorer/.
Just to give you an idea, here’s the POST I’m using: https://analyticsdata.googleapis.com/v1beta/properties/{propertyId}:runReport and the following body:
`json
{
“dateRanges”: [
{
“startDate”: “2022-08-29”,
“endDate”: “2022-12-07”
}
],
“dimensions”: [
{
“name”: “customEvent:institution_id”
},
{
“name”: “pagePathPlusQueryString”
}
],
“dimensionFilter”: {
“andGroup”: {
“expressions”: [
{
“filter”: {
“fieldName”: “customEvent:institution_id”,
“inListFilter”: {
“values”: [
“47339486-a1e5-47be-abce-e4270af23rte”
]
}
}
},
{
“filter”: {
“fieldName”: “pagePathPlusQueryString”,
“stringFilter”: {
“matchType”: “PARTIAL_REGEXP”,
“value”: “/clip/.+”,
“caseSensitive”: false
}
}
}
]
}
},
“metrics”: [
{
“name”: “screenPageViews”
}
],
“metricAggregations”: [
“TOTAL”
],
“limit”: “10000”
}
`
What do you think? Can you help me out on this?
Log in to reply.