statistics information about site usage

Author Message

Manuele Arenghi

Thursday 01 July 2010 6:01:33 am

Hello,

My site is on ezpublish 4.3.0 and php 5.3,with mysql 5.1.38.My site is accesible only by registered users .

I need to get statistical informations about usage of my site by different users.

I would like to get informations about :

-how many visits each user has at my site in a period of time(one mouth for example)

-what operations each user has done

-how much time each user has spent on my site

Is there a way to get these informations?

Where are these information stored on the ezpublish application?Can you suggest a method to get these informations?

Thank you

Manuele

http://manuele.ath.cx

Manuele Arenghi

Wednesday 07 July 2010 2:09:23 am

As usual I got no answer......so I did by myself:

I've installed the extension BC Website Statistics,following the article:

http://share.ez.no/articles/ez-publish/how-to-use-ez-publish-extensions-google-analytics

and it works fine .This extension gives detailed information about visits and contents .Although these informations do not match my aim which is to be aknowledged about user of my ezpublish site:

if I have 3 user:

user1,user2,user3 who are allowed to login at my ezpublish site I need to know the pages each user has viewed-

- Is there any extension or any solution to reach these statistics?

I also analysed DB and I find some informations on table "ezcontentbrowserecent" on which are stored the insert and edit operations of my users .Although when a user does an operation on a page he just edited before , the system update the date of the line already present in the table and does not add a new line,this cause the loss of history of operations and prevent to reach the aim of having statistical informations .

-Is there a way to have the system insert a new line on the table "ezcontentbrowserecent" each time a user does an operation?

Another interesting table is "ezuservisit" .Does anyone knows if the field "login_count" counts the login of each user from the beginning of the site whether this field as some times or other limitations?

Thanks

Manuele

http://manuele.ath.cx

Gaetano Giunta

Wednesday 07 July 2010 3:29:11 am

Slightly offtopic, but the audit.ini settings file might give you a little bit of extra info, too...

Principal Consultant International Business
Member of the Community Project Board

Gaetano Giunta

Wednesday 07 July 2010 3:36:24 am

ps: what about adding ez's session cookie to your apache logs? this way you do not need to alter eZP code (make it either slower or add ever-increasing tables). I guess you could write a custom logon handler that sets a cookie with current username, too, if that's what you are interested in.

You can then start searching for tools that parse that information and give back to you a nice interactive analytics console with clickstream tracking and drill-down to per-visitor

Principal Consultant International Business
Member of the Community Project Board

Manuele Arenghi

Monday 12 July 2010 12:18:27 am

Thanks for your answer ,

I configured audit.ini and it gives informations about uers'logins,but not informations about users operations like views and edit pages .It would be interesting if audit.ini will log these more informations too.

I want trying with your second suggestion but I don't know how to start . Please,could you send some links about this solution?

I have a perplexity on this second way:if a user has cookies disabled ,will this solution work anyway?

Thank you

http://manuele.ath.cx

Gaetano Giunta

Monday 12 July 2010 1:01:49 am

About cookeis: I fear that with cookies disabled, no user would be actually able to log in to eZP...

Principal Consultant International Business
Member of the Community Project Board

Manuele Arenghi

Monday 12 July 2010 7:55:28 am

I set apache to log session cookies with this line in httpd.con:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\"" combined-cookie

Now apache access log after the login is as follows-

My question is:Where is username information?

192.168.0.3 - - [12/Jul/2010:16:23:24 +0200] "POST /EZ/index.php/backoffice/user/login HTTP/1.1" 302 238 "http://192.168.0.6/EZ/index.php/backoffice/user/login" "Mozilla/5.0 (Windows; U; Windows NT 6.0; it; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 ( .NET CLR 3.5.30729)" "contentStructureMenu=2/7201/43/5/6828/7405/7601/7406/59/15/44/6824/7202/61/7420/7407/7408/7602/7603/7604/7605/7606/9197/9200/9201/9205/13/8052/6924/6819/9829/9830/9842/9843/9844/7226/7599/7600/9845/9847/9849/9854/10033/10102/10104/10108/10109/10125/7189/7191/7151/12; __utma=224267611.733475483.1278405443.1278589066.1278591434.10; __utmz=224267611.1278405443.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); eZSESSID61ccb696986954abbe14bce266a373a7=1u038h5vff4ujv97sl85vogqo0"

192.168.0.3 - - [12/Jul/2010:16:23:24 +0200] "GET /EZ/index.php/backoffice/Gruppo-Leonardo HTTP/1.1" 200 12030 "http://192.168.0.6/EZ/index.php/backoffice/user/login" "Mozilla/5.0 (Windows; U; Windows NT 6.0; it; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 ( .NET CLR 3.5.30729)" "is_logged_in=true; contentStructureMenu=2/7201/43/5/6828/7405/7601/7406/59/15/44/6824/7202/61/7420/7407/7408/7602/7603/7604/7605/7606/9197/9200/9201/9205/13/8052/6924/6819/9829/9830/9842/9843/9844/7226/7599/7600/9845/9847/9849/9854/10033/10102/10104/10108/10109/10125/7189/7191/7151/12; __utma=224267611.733475483.1278405443.1278589066.1278591434.10; __utmz=224267611.1278405443.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); eZSESSID61ccb696986954abbe14bce266a373a7=vafcsg6uv8qfq0v0h39fquaeu2"

http://manuele.ath.cx

STEVO +

Monday 12 July 2010 9:29:36 am

I think this extension provides the ability to set a cookie with a username:

http://projects.ez.no/ezvlogin

Might save you some time

Manuele Arenghi

Tuesday 13 July 2010 6:33:47 am

Thanks for the link Stevo,

I have download the extension and activated it .It allows to have a cookie with username information.

I have set this in vlogin.ini.append.php:

# (optional) Cookie Name to use for user name
UserNameCookieName=userNameVLogin

-----------------------------------------------------------------------------------------------------------------------------------------

Although before your reply I found another solution that reach the same result(I started reading http://share.ez.no/forums/developer/static-cache-get-user-login-information-by-cookie-js):

I modifids index.php as follow:

<<

if ( $currentUser->isLoggedIn() )
{
$userID = $currentUser->attribute( 'contentobject_id' );
$userObject = $currentUser->attribute( 'contentobject' );
$userName = $userObject->name();
setcookie( 'username', $userName , 0, $cookiePath );
setcookie( 'userId', $userID , 0, $cookiePath );
setcookie( 'is_logged_in', 'true', 0, $cookiePath );
header( 'Etag: ' . $currentUser->attribute( 'contentobject_id' ) );
}

>>

This way I have also userID information and any other information I wanted .

-----------------------------------------------------------------------------------------------------------------------------------------

Now I have to decide which solution is better:

1-

when I 'll have to upgrade my ezpublish installation it would be better having to remember to change index.php file or it would be better having to update the extension and to test if this extension would work correctly with the upgrade?Can you suggest the better solution?

2-

Another task:

Now my apache log contains also cookie information with the logged user' username :

There are many programms that allow to get statistics from apache log .Do you know if there is a program that could be better considering that my main log information is in the cookies?

-----------------------------------------------------------------------------------------------------------------------------------------

Thank you all -

http://manuele.ath.cx

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

eZ debug

Timing: Jan 15 2025 09:01:37
Script start
Timing: Jan 15 2025 09:01:37
Module start 'layout'
Timing: Jan 15 2025 09:01:37
Module start 'content'
Timing: Jan 15 2025 09:01:38
Module end 'content'
Timing: Jan 15 2025 09:01:38
Script end

Main resources:

Total runtime1.0874 sec
Peak memory usage6,144.0000 KB
Database Queries77

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 689.1328183.7031
Module start 'layout' 0.00620.0030 872.835952.5938
Module start 'content' 0.00921.0766 925.42971,922.9844
Module end 'content' 1.08580.0016 2,848.414180.5234
Script end 1.0874  2,928.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00590.5408160.0004
Check MTime0.00130.1218160.0001
Mysql Total
Database connection0.00080.069510.0008
Mysqli_queries0.977189.8555770.0127
Looping result0.00080.0755750.0000
Template Total1.052196.820.5261
Template load0.00400.370020.0020
Template processing1.048196.384720.5241
Template load and register function0.00110.100210.0011
states
state_id_array0.00100.088010.0010
state_identifier_array0.00090.087020.0005
Override
Cache load0.00390.3548870.0000
Sytem overhead
Fetch class attribute can translate value0.00050.050230.0002
Fetch class attribute name0.00300.2776110.0003
XML
Image XML parsing0.00340.309230.0011
class_abstraction
Instantiating content class attribute0.00000.0029130.0000
General
dbfile0.00390.3583220.0002
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 28
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs