Custom dimensions are not tracked in Google Analytics HTTP requests (measurement protocol)
When using analytics.js, I can successfully track events including custom dimensions this way (as described in the docs ):
ga('send', 'event', 'category', 'action', {
'metric18': 8000,
'dimension6': 'crocodile'
});
However, when using the measurement protocol (i.e. HTTP requests), I cannot find a way to include custom dimensions and metrics in event tracking, since I did not find a reference in the documentation.
This is what I have tried so far (based on examples found in the documentation ). In both cases, the event was indeed tracked, but without any custom dimensions or associated metrics.
http://www.google-analytics.com/collect?
v=1 // Version.
&tid=UA-XXXX-Y // Tracking ID / Property ID.
&cid=555 // Anonymous Client ID.
&t=event // Event hit type
&ec=video // Event Category. Required.
&ea=play // Event Action. Required.
&metric18=8000
&dimension6=crocodile
and
http://www.google-analytics.com/collect?
v=1 // Version.
&tid=UA-XXXX-Y // Tracking ID / Property ID.
&cid=555 // Anonymous Client ID.
&t=event // Event hit type
&ec=video // Event Category. Required.
&ea=play // Event Action. Required.
&el={"metric18":8000,"dimension6":"crocodile"}
+3
source to share
1 answer
Based on devvide you are using incorrect parameter names, please try:
http://www.google-analytics.com/collect?
v=1 // Version.
&tid=UA-XXXX-Y // Tracking ID / Property ID.
&cid=555 // Anonymous Client ID.
&t=event // Event hit type
&ec=video // Event Category. Required.
&ea=play // Event Action. Required.
&cm18=8000
&cd6=crocodile
(The devguide part you were looking for is for JS web tracking instead of collection.)
+7
source to share