Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to add custom dimensions at different levels in measurement protocol google analytics

I want to have some more dimensions so that the data for the user is more human readable. I have set values such as { v: '1', tid: 'UA-XXXXX-1', cid: '55555', t: 'event', ec: 'GA', ea: 'GA_Recharge', el: 'Recharge_NameofUer', ev: '30' }

which provides me a three layered dimension but I want to add some more dimensions how could i achieve that.

like image 340
Shantanu Madane Avatar asked Oct 18 '22 11:10

Shantanu Madane


1 Answers

Seems like you are tracking events through the measurement protocol. Events have by default 3 dimensions:

  • Event Category (ec)
  • Event Action (ea)
  • Event Label (el)

If you want to add more the first idea is to create customDimensions. You can have up to 20 custom dimensions (200 for GA360 clients).

You need to setup them on the interface first. You haven't given much information about your use case but I'll guess you want to set them with Hit Scope Level. Give each one a descriptive name on the UI and take note of their indexes.

Then you can use them in the measurement protocol with the parameter cdX, like this:

  • Custom Dimension 1 (cd1)
  • Custom Dimension 2(cd2)
  • ...
  • Custom Dimension 20 (cd20)

You can later create custom reports that mix these dimensions with the Event(Category|Action|Label) for easy reporting.

like image 154
Eduardo Avatar answered Oct 21 '22 09:10

Eduardo