Lists the key events (conversions) of a Google Analytics 4 property with their counting method and default value.
curl -X POST "https://api.primaryapi.com/v1/run/google-analytics.key_events" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"propertyId":"312345678"}'{
"output": {
"found": true,
"data": {
"nextCursor": null,
"keyEvents": [
{
"name": "properties/312345678/keyEvents/6512…",
"custom": false,
"deletable": true,
"eventName": "purchase", …
}, …
],
"propertyId": "312345678"
}
},
"credits": 1
}Input and output
4 fields
312345678.8 fields
Good to know
Runs as your connected Google account. Needs the Read Google Analytics capability.
Mark another event as a key event with google-analytics.create_key_event.
A property the account cannot see is a miss with reason no_access.
One page per call. Send nextCursor back as cursor to read the next page.
Unknown property ID? It comes back as not found, not as an error.
The same key and credits work for every API.