Track Website Activity

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
mmobra
Forum Newbie
Posts: 4
Joined: Tue Jan 10, 2017 11:41 am

Track Website Activity

Post by mmobra »

Hi All

New to PHP Programming and Im having an issue trying to get this working.

I have a site that basically has reports and I need to track (user login/logoff, report downloads, how many times each user searches each report ect...)

I would need that to either go to a log file or excel or something.

Help please
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Track Website Activity

Post by requinix »

Okay. Is there a specific issue you have, or are you asking for general advice?
mmobra
Forum Newbie
Posts: 4
Joined: Tue Jan 10, 2017 11:41 am

Re: Track Website Activity

Post by mmobra »

I am asking for general advice on how to do this.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Track Website Activity

Post by requinix »

Put everything into a database first, then you can export it into whatever format you want later.

Can you come up with a list of exactly what you need to track? Or at least the types of things you want to track, like "when the user does something with a report"?
mmobra
Forum Newbie
Posts: 4
Joined: Tue Jan 10, 2017 11:41 am

Re: Track Website Activity

Post by mmobra »

I would like to track the following...

1. When a person logs on and off.
2. What reports they download.
3. How many times they search a report.

For starters that would be great.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Track Website Activity

Post by requinix »

I'm asking because it might be annoying later to discover you want other reports that don't quite fit into the system you'll be designing now.

I suggest two log tables: one for login and logout actions (with ID, date, user ID, and action like "login" or "logout"), the other for report-based actions (with ID, date, user ID, report ID, and action like "download" or "search"). Insert into them when the respective actions occur.
mmobra
Forum Newbie
Posts: 4
Joined: Tue Jan 10, 2017 11:41 am

Re: Track Website Activity

Post by mmobra »

Do we have some code that I can try as like I said before very new to this?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Track Website Activity

Post by requinix »

Not really.

How were the sites originally developed? Whoever did that would be the best to add this logging functionality, because otherwise you'll need to start learning some web programming - PHP, MySQL, stuff like that.
Post Reply