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

I develop a website on that people can create their own subpages with some tools i provide. And i would like to add the ability for users to see statistics without setting them on their own (like with Google Analytics. So i need some SAAS or PHP scripts for statistics that meets this criteria:

  • it's easy to create new account in statistics programmatically when person creates account on my website
  • it's easy to integrate my login mechanism with the login mechanism of the statistics
  • person sees only his statistics and not other people statistics
  • statistics are enabled on a website by adding some JS script to user subpage.

Do you any software of this kind that is easy to deploy?

share|improve this question

migrated from stackoverflow.com Jan 29 '12 at 14:06

This question came from our site for professional and enthusiast programmers.

2 Answers 2

There are multiple possibilities.

1. Write your own solution

Just store some data (visitor ip, path, browser, etc.) in a MySQL table. Then use GROUP BY statements to extract numbers from your data. Pro: You have full control. Con: It means a lot of work.

2. Integrate some analytics solution

Easier to setup, but you will probably end up with a fully featured analytics solution you won't need.

3. Google Analytics API to the rescue

The easiest solution is probably to use the Google Analytics API. You can just pull the data you need and you can get data visualisation from Google Charts. This way you can set up your analytics in about 5 lines of code.

share|improve this answer
    
5 lines of code? Even the simply setting up oauth2 is a pain in the backside. But sadly, it's the only way to go. –  Christian Sciberras Jan 22 '12 at 21:42
    
Sorry maybe i didn't it clear in the question. I don't want to write my own solution. I know developing good statistics is work for years. Therefore i want to use someones project not duplicate work. 3 is not a solution for me because i would end up duplicating whole interface of Google Analytics on my website so that to display data via Google Analytics APi and Google Charts. And thats just another duplication of work. It's basically not better for me than 1. So it's 2. -> do you know any solutions that fits? –  tomaszs Jan 23 '12 at 2:11

For the solution number 2, you could use any of the many web analytics libraries available, but I still think going with Google API would be the best solution here.

Some of the libraries that I know of:

share|improve this answer

Your Answer

 
discard

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