1

I am using google analytics collects API call

https://developers.google.com/analytics/devguides/collection/protocol/v1/reference#using-post

I just wanted to know whether it supports multiple custom dimensions in post-call

This is post body which I am sending

v=1&tid=UA-XXXXXXX-YY&cid=555&t=event&el=holiday&ea=play&cs=(direct)&cm=organic&ec=video&ev=55&cd1=Sports&cd2=Music

where cd1 and cd2 are custom dimensions

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
Afeefa KTK
  • 11
  • 1
  • I wanted to know how to send custom dimensions in this https://developers.google.com/analytics/devguides/collection/protocol/v1/reference#using-post API call If we have multiple custom dimensions how can it be sent through post body? If so how is the format? May be help with the correct curl request? Any idea? – Afeefa KTK Feb 02 '22 at 09:32

1 Answers1

0

If you check the documentation for Custom Dimensions / Metrics

enter image description here

You will notice that the dimension has an index attached.

so if you want to send a value for custom dimension 1 you send it as cd1 if you want to send a custom dimension for custom dimension 2 then you send cd2.

These are the custom dimensions set up in your google analytics account.

enter image description here

The index is the index number you send to the measurement protocol.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449