Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

We build a webapp that allows users to run the app under their own subdomain. So we run the app under search.domainX.com, search.domainY.com and so on. They each have their own Google Analytics to track individual stats. But we want to know what general traffic for all clients of our app. So we want to know stuff like "among all our clients we had x number of views." What is the best way tool to track that sort of thing. We prefer a snippet based solution similar to Google Analytics if possible.

share|improve this question
    
We went with Quantcast for now. It gives us a good idea of our traffic across domains. –  kidbrax Nov 8 '11 at 14:57
add comment

3 Answers

You can send tracking data to multiple Analytics accounts using the asynchronous tracking API to send multiple commands. For example:

<script type="text/javascript">

  var _gaq = _gaq || [];

  //Send data to the client's Google Analytics account
  _gaq.push(['_setAccount', 'UA-12345-1']);
  _gaq.push(['_trackPageview']);

  //Send data to your Google Analytics account
  _gaq.push(['b._setAccount', 'UA-12345-2']);
  _gaq.push(['b._setDomainName', 'none']);
  _gaq.push(['b._setAllowHash', 'false']);
  _gaq.push(['b._setAllowLinker', true]);
  _gaq.push(['b._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>

This will send data to their Analytics account (UA-12345-1) for visits to that domain only, and it will send data to your Analytics account (UA-12345-2) for all sites using your app, so long as you include the code on every installation.

The best way to implement this would be to build Google Analytics into your app, and prompt users for their 'UA-12345-1' Analytics account code. That way, they won't have to add Analytics code themselves, which might risk messing up your setup.

You should also mention to them that you're tracking their usage of the app in order to improve your product, either directly or in your terms and conditions.

share|improve this answer
add comment

I assume that you have access to the servers behind the search.*.com domains. In that case you could just combine the log files for each domain into one big one. Then the question becomes "which is the best tool for getting stats out of log files?", which is a separate question!

share|improve this answer
    
Yes, we have access to the log files but I was hoping for a javascript based solution such as Google Analytics. –  kidbrax Mar 17 '11 at 19:25
    
In that case this article google.com/support/googleanalytics/bin/… will probably help. It tells you to add code for when you go between domains. I think that's so when you go from one to another it doesn't count as a new visitor in the domain you are going to. I would have thought in your case that doesn't apply. –  paulmorriss Mar 18 '11 at 8:57
add comment

Piwik is an open source, user friendly web analytics free solution.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.