Monitor site clicks

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Zavin
Forum Newbie
Posts: 11
Joined: Fri Feb 29, 2008 6:28 pm

Monitor site clicks

Post by Zavin »

I am wanting to track clicks in my php site. I'm thinking that if I was able to monitor where my users where and where not clicking I could figure out how to better direct my traffic. Are there any good pre-made scripts or would I be better off writing something my self? And if I do write something myself will I need to write the code for every link in my site or is there a way to write it to just monitor every click?
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

Re: Monitor site clicks

Post by WebbieDave »

Your web server logs every file that is requested. You could just use a log analyzer to find out what pages people are visiting.

If you want to roll your own logging mechanism (say you want to keep track of the pages visited in a particular session, and that session is handled in a cookie rather than the URL), you can include in all your php pages some code that stores the session id, page and timestamp in a database. I'm not sure of any premade scripts that do this but the basics would be trivial to code.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Monitor site clicks

Post by Eran »

Try google analytics
Zavin
Forum Newbie
Posts: 11
Joined: Fri Feb 29, 2008 6:28 pm

Re: Monitor site clicks

Post by Zavin »

The session thing may be my best bet. Every member has to log in which starts a session and every page is wrapped with the header. So I guess I could write something in the header that would log every click into my database.

*to pytrin: I'm not sure analytics is going to work for me every search returned either a large script that is more than I need or a better way for logging search engine clicks.
User avatar
lonelywolf
Forum Commoner
Posts: 28
Joined: Tue Jun 10, 2008 6:15 am

Re: Monitor site clicks

Post by lonelywolf »

Zavin wrote:...And if I do write something myself will I need to write the code for every link in my site or is there a way to write it to just monitor every click?
I think it's the problem of your code architect. If you setup a framework and using one point of access (many MVC frameworks implement this concept...), so it's not too difficult to archive your purpose.
Post Reply