Marks an event as a key event (conversion) in a Google Analytics 4 property (a change to the connected account).
curl -X POST "https://api.primaryapi.com/v1/run/google-analytics.create_key_event" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"propertyId":"312345678","eventName":"generate_lead"}'{
"output": {
"found": true,
"data": {
"name": "properties/312345678/keyEvents/6599…",
"custom": true,
"deletable": true,
"created": true, …
}
},
"credits": 1
}Input and output
5 fields
312345678.generate_lead.10 fields
Good to know
Changes your account. This call creates, edits or deletes something in the connected account, live. Confirm before running it. With an Idempotency-Key it never runs twice, and monitors can’t schedule it.
WRITE: changes the connected Google Analytics property: the event is marked as a key event in its reports.
Needs the Manage Google Analytics capability. Edit access to the property.
Safe to repeat. When the event already is a key event it is returned unchanged with created: false.
A property the account cannot change is a miss with reason no_access. Nothing changes.
Unknown property ID? It comes back as not found, not as an error.
The same key and credits work for every API.