Lists the dimensions and metrics a Google Analytics 4 property can report on, including its custom ones, with their API names.
curl -X POST "https://api.primaryapi.com/v1/run/google-analytics.metadata" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"propertyId":"312345678"}'{
"output": {
"found": true,
"data": {
"dimensions": [
{
"customDefinition": false,
"apiName": "sessionDefaultChannelGroup",
"uiName": "Session default channel group",
"description": "The session's default channel group…", …
}, …
],
"metrics": [
{
"customDefinition": false,
"apiName": "sessions",
"uiName": "Sessions",
"description": "The number of sessions that began o…", …
}
],
"propertyId": "312345678"
}
},
"credits": 1
}Input and output
5 fields
312345678.6 fields
Good to know
Runs as your connected Google account. Needs the Read Google Analytics capability.
Use the apiName values in google-analytics.report.
Narrow the list with type, search or customOnly (the full list is long).
A property the account cannot see is a miss with reason no_access.
Unknown property ID? It comes back as not found, not as an error.
The same key and credits work for every API.