views:

39

answers:

1

I have 10 servers (will eventually be hundreds) that I need to profile using google analytics. On each of these servers I have plain vanilla tracking code with custom variables as follows:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXXXXX-1']);
  _gaq.push(['_setDomainName', 'cloud.nimbox.com']);
  _gaq.push(['_setCustomVar', 1, 'box', 'box99', 3]);
  _gaq.push(['_setCustomVar', 2, 'user', 'usr99@box99', 3]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

Where box99 changes for each of the servers and user99@box99 changes for each user of each server

I'm getting all the information on the master profile cloud.nimbox.com but I would like to create an independent/filtered profile for each customVar box; i.e., a profile for box01, a profile for box02, which are created by filtering the original cloud.nimbox.com. I've been trying with different filtering elements without success. Any ideas?

+2  A: 

Custom filters don't yet support Custom Variables (stupidly, in my view).

You'll need to pass that information additionally using a different data point; User Defined Variable (the predecessor to Custom variables) could be a solution, as it is an option for filtering. The drawback with User Defined Variable is that you can only set one at a time, but that seems like it will work fine for storing the server name, and then keep both of your current custom variables for other data operations.

Alternately, you could have a single profile and use Advanced Segmentation (which does support segmenting by custom variable value).

yc
What if I use `_gaq.push(['_setDomainName', 'box99.cloud.nimbox.com']);` even though I'm accessing the server via its IP address? Could I still use the domain name as a filter in the profile?
rmarimon
No, that won't work. `_setDomainName` is for setting the domain of the cookies (to, say, '.cloud.nimbox.com') so they can track across subdomains (box 1-99), not for altering the Host Name; http://code.google.com/apis/analytics/docs/gaJS/gaJSApiDomainDirectory.html#_gat.GA_Tracker_._setDomainName. If you do that, it might not fire the _utm.gif hit to Google, and none of your hits will be tracked.
yc
So if users are accessing the site by ip because is an internal site. Then I should set the '_setDomainName' to 'none' so that cookies have no domain and they can travel back and forth?
rmarimon
Not totally sure, but I think the answer is no, you don't need to set any _setDomainName (not even 'none') since the domain isn't actually changing for them; it'll always appear as the IP address, so the cookies will set as that IP address.
yc
Further looking pointed towards Advanced Segments. This seems to be a way in which I can create "filters" that act on custom variables. Not only this but changing this advanced segments work in the history which is something that wouldn't have worked with the regular profile/filter approach.
rmarimon
yc