Techniques for monitoring usage by user?

Author Message

Willie Seabrook

Sunday 28 December 2003 4:56:48 pm

Hi,

We need to be able to monitor usage by user from an internal Filemaker database (I have already done the ezpublish-filemaker database syncing code). Just need simple stats like

1. number of logins
2. last login
3. content objects viewed

etc

Does anyone have any ideas on how this would be best accomplished? I've had a thorough look through the database structure but I can't find any fields that contain this information.

Might this sort of info be decodable from the session key?

Maybe I could put a hook into the login code to fill another database table.

Maybe I could add a pre view trigger to fill another database table with info?

Any ideas?

Regards,
Willie

Willie Seabrook

Thursday 01 January 2004 2:42:51 am

I think I'll do it this way:

A hack in the user code to insert each login timestamp and user id into a database table.

A workflow event triggered before a view to insert the view timestamp and content object and user id into a database table.

Anyone have *any* comments?

Marco Zinn

Thursday 01 January 2004 10:56:52 am

Hi Willie,
sounds like a reasonable solution for your request.
I think, you should try to NOT change the core files, but just introduce a new workflow, which you should trigger before (or after) viewing content.
When we assume, that the user is redirected to some "content" page (which usually is true), you could also handle the login counting in your workflow. You'd probably need to find some way to find out, if you already counted the current login... probably by storing some sessions information.

Pseudo-Code:
1 Check in the for for the latest login of the current user.
2 If there is an entry in the DB, check for the stored session and compare it to the current session
3. If there is no DB entry yet OR the stored session is not the current session, store that login (time) and increase the login counter for the user
4. Store the information: This user has seen this node at this time

Of course the session-checking will be some ugly overhead, but I think, there is no "after-login" trigger, that you could use.
Beware: You will create quite some data, so think of ways to analyse and clean your data from time to time.

BTW: I'm very much interessted, if you manage to get something going there, as this (user tracking) is of interrest for me, too.

Marco
http://www.hyperroad-design.com

Willie Seabrook

Thursday 01 January 2004 7:28:36 pm

Thanks for your comments.

I will post all of the code when I do it. I've actually got quite a few things I've done for ez that I need to get around to publishing....

Marco Zinn

Sunday 04 January 2004 6:35:59 am

Sounds interessting... Will you give us a quick sneak preview of what you want to publish? ;)

Marco
http://www.hyperroad-design.com

Willie Seabrook

Sunday 04 January 2004 7:12:15 pm

Well I'll be starting on the user stuff in a couple of days, so who knows when that will be done. Things are hectic at the moment and just don't have time to document & submit to svn yet.

I will definately publish the login information extension as soon as its done cause I think a lot of people will find that usefull.

Maarten Holland

Friday 09 January 2004 11:21:42 am

I sure do so I'm looking forward to it. Thanks in advance!

Marco Zinn

Friday 09 January 2004 12:15:22 pm

Thanks in advance, Willie

Marco
http://www.hyperroad-design.com

Ekkehard Dörre

Wednesday 01 December 2004 8:24:37 am

Hi Willie,

any news about this feature?

Thanks, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.