views:

261

answers:

2

Hi there

The situation I'd like to use GA to track some serverside operations. That's why I cant make use of the GA Javascript fuctions. But, as you might know, you can request the utm.gif right from your server. This already works fine.

The Problem I'd like to trackt custom parameters. But i have no idea how to add them in the right format to the url-request

This one should do the custom parms. But I did't get any results in GA.

utme=5(Init*load_success*http://www.mydomain.de)8(userstatus)9(fan)11(2)

Full list of params:

    ref   ts
    utmac   UA-XXXXXX-5
    utmcc   __utma=186215409.1789216404.1265552708.1280074861.1280493144.21;+__utmz=;
    utmcs   ISO-8859-1
    utmdt   Button
    utme    5(Init*load_success*http://www.mydomain.de)8(mycustomvar)9(mycustomvalue)11(2)
    utmfl   -
    utmhn   mydomain.de
    utmje   -
    utmn    1114675642
    utmp    button
    utmr    http://www.mydomain.de
    utmsc   -
    utmsr   -
    utmul   de-de
    utmwv   4.5.7
+1  A: 

not sure what's going wrong, given what you posted, but how about you write out what you want to send the traditional way (with javascript) and put it on a test page. Use firebug or whatever to grab the requested url that's built and compare it to what you have now.

Crayon Violent
p.s. - dunno if you knew or not but GA has a 24hr delay on data showing up.
Crayon Violent
Also you may need to set your host (fake a browser's host info), GA may be receiving it just fine but weeding it out.
Crayon Violent
A: 

The value of the utme gif Request parameter is encoded by ga.js--it's the only one that is, as far as i know.

Calling *__trackEvent* is the usual way to set the value of utme. These are client-side events though, which is no doubt why you are trying to set utme directly.

So if you just want to bind 5(Init*load_success*http://www.mydomain.de)8(userstatus)9(fan)11(2) to the variable utme, and you can't rely on user-behavior to trigger that binding, then here's what i suggest:

Pack your data into a 'custom variable' scoped to the page--this way, when the __trackPageview() is called, the value will be set.

Here's the analytics code required in your HTML to implement that:

The method signature for a custom variable:

pageTracker._setCustomVar(slot,    // integer between 1 and 5, inclusive (just use '1')
                          name,    // user-defined name for the custom variable
                          value,   // string representing the value for the custom variable
                          scope,   // you want '3' for page-level (an int, not a string though)  
);

Within the HTML (order matter, of course):

pageTracker.__setCustomvar(1, "A Name", "A Value", 3);
pageTracker.__trackPageview();

A key point here is that the parameter 'value' can be set dynamically, so for the 'value' parameter, i guess you want to pass in 5(Init*load_success*http://www.mydomain.de)8(userstatus)9(fan)11(2)

Finally, here are the two key sources (Implementation Guide, Usage Guide) on Custom Variables from the GA Team

doug
He wants to use it to track server-side operations, not client-side operation. Hence not using javascript.
Crayon Violent
Well, javascript is used to capture/record server-side data all the time (e.g., count 404s served). The constraint in the OP's Q--as they have described it--is that they want to measure something *not* triggered by user interaction (e.g., you can't use event tracking, which is what i think he might have tried). The solution i offered captures the information using js and that capture is triggered on page loading.
doug