Creates a custom dimension in a Google Analytics 4 property from an event parameter, user property or item parameter (a change to the connected account).
curl -X POST "https://api.primaryapi.com/v1/run/google-analytics.create_custom_dimension" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"propertyId":"312345678","parameterName":"article_author","displayName":"Article author","description":"Author of the article viewed","scope":"EVENT"}'{
"output": {
"found": true,
"data": {
"name": "properties/312345678/customDimensio…",
"disallowAdsPersonalization": false,
"displayName": "Article author",
"created": true, …
}
},
"credits": 1
}Input and output
7 fields
312345678.article_author.Article author.EVENT.Author of the article viewed.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.
Needs the Manage Google Analytics capability. Edit access to the property.
A custom dimension cannot be deleted through the API. Only archived, and properties have a limited number of them, so create only what you will report on.
scope and parameterName cannot be changed later.
Safe to repeat. An existing dimension with the same scope and parameterName is returned unchanged with created: false.
The same key and credits work for every API.