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.
You can send tracking data to multiple Analytics accounts using the asynchronous tracking API to send multiple commands. For example:
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.
Piwik is an open source, user friendly web analytics free solution.