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
?
How does Google Analytics event tracking work? A snippet of custom code is added to the link code on the items you want to track on your website and when the item is clicked, the element is tracked and displayed as an event in Google Analytics.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With