Forums / Developer / statistics information about site usage

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