views:

461

answers:

1

I'm currently in the process of programming an utility which generates GA tracking pixel (utm.gif) URL:s based on given parameters. For those of you who are wondering why I'm doing this on the server side, I need to do this server side since the context which I'm going to start tracking simply doesn't support JavaScript and as such ga.js is completely useless to me.

I have managed to get it working otherwise quite nicely but I've hit a snag: I can't track events or custom variables because I have no idea how exactly the utme parameter's value should be structured to form a valid event or var type hit. GA's own documentation on this parameter isn't exactly that great, either.

I've tried everything from Googling without finding anything (which I find ironic) to reverse engineering ga.js, unfortunately it's minified and quite unreadable because of that. The "mobile" version of GA didn't help either since officially GA mobile doesn't support events nor vars.

To summarize, what is the format of the utme parameter for page hit types event and custom variable?

+1  A: 

I have not tried this myself but by reading your GA documentation link and the GA Event Tracking Guide. Then the equivalent code to:

var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._trackEvent('my_category', 'my_action', 'my_label', 'my_value');

would result in a utme parameter like (I am not sure if this needs to be encoded but it couldn't hurt):

utme=5(my_category*my_action*my_label)(my_value)
Mark McLaren
You know, I have a creeping suspicion that information wasn't there three days ago. Any idea of the format for multiple events per request?
Esko
I have exactly the same experiences with Google documentation and sometimes stuff that you knew was there disappears! My guess is that you could set multiple utme parameters – although I could not find any documentation to support this. I did find a nice short presentation about event tracking. http://services.google.com/analytics/breeze/en/et_vps/index.html
Mark McLaren