Fórumok

How tracking user click

Bobo De Bobis, módosítva 10 év-val korábban

How tracking user click

New Member Bejegyzések: 11 Csatlakozás dátuma: 2013.08.01. Legújabb bejegyzések
Hi,
I would tracking user click stream, for example I would know if user read a blog or read any portlet.
With hook, I can track only models CRUD and servlet event, but with servlet events I cannot know portletID (is null) :-(

How I can do?

Thank in advance,

Bobo
thumbnail
David H Nebinger, módosítva 10 év-val korábban

RE: How tracking user click

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Step up to Liferay EE where you can use the audit portlet to audit user activity.
Bobo Jager, módosítva 10 év-val korábban

RE: How tracking user click

New Member Bejegyzések: 11 Csatlakozás dátuma: 2013.08.01. Legújabb bejegyzések
Thanks but I would only user navigational tracking within CE...Is it impossible?
As start point, how I can intercept the blog reading/rendering?

Thanks in advance
thumbnail
lou cat, módosítva 10 év-val korábban

RE: How tracking user click

Regular Member Bejegyzések: 196 Csatlakozás dátuma: 2012.01.26. Legújabb bejegyzések
Hi Bobo,

If you place the blog as the only portlet in a certain page, you can certainly track if a user read that page... would it work for you?
Bobo Jager, módosítva 10 év-val korábban

RE: How tracking user click

New Member Bejegyzések: 11 Csatlakozás dátuma: 2013.08.01. Legújabb bejegyzések
lou cat:
Hi Bobo,

If you place the blog as the only portlet in a certain page, you can certainly track if a user read that page... would it work for you?



Thanks Lou,
I'm novice. Could you do an example? How can I track if a user read that page? Where I should work?

Thanks
thumbnail
lou cat, módosítva 10 év-val korábban

RE: How tracking user click

Regular Member Bejegyzések: 196 Csatlakozás dátuma: 2012.01.26. Legújabb bejegyzések
You could hook the LayoutPostAction which is triggered everytime a page (=layout) is visited (with a normal http request).

Have a look at how to develop a hook, in particular in this section:

Performing a Custom Action
Bobo Jager, módosítva 10 év-val korábban

RE: How tracking user click

New Member Bejegyzések: 11 Csatlakozás dátuma: 2013.08.01. Legújabb bejegyzések
LayoutPostAction is supported by portal.properties? Can you explain your solution basically?

By your link:
"Custom action hook plugins aren’t limited to the log in event. You can define custom actions for other events, too. For actions that require access to the HttpServletRequest, extend com.liferay.portal.kernel.events.Action; for others, extend com.liferay.portal.struts.SimpleAction"
thumbnail
lou cat, módosítva 10 év-val korábban

RE: How tracking user click

Regular Member Bejegyzések: 196 Csatlakozás dátuma: 2012.01.26. Legújabb bejegyzések
Yes it is supported, I've created a custom LayoutPost action and I used this property in order to make liferay call my custom class everytime someone requests a page:

servlet.service.events.post=com.sample.hook.MyLayoutPostAction

In the class itself I get the userId of the logged-in user, the URL of the layout (=the page the user is visiting), the date/time, and I saved it in my database using ServiceBuilder.

I hope this gives you a better idea!