php - Symfony2 count visited sites per user -
I'm trying to count how many pages the user visited during their login.
I have created a service
that is listening to the kernel :: termininate
event that goes to a user at another site at all times System
The code will be called, which is fine, but up to 10 times the change per page, which is obviously too much!
I also tried the kernel :: request
event, but with the same result.
What can I do that it only increases PageConverter once, new page request? (For example, the user gives a specific bill details from the billing overview)
kernel: : VIEW
is removed when the controller action response is returned. If you want to track users reaching from one scene to another, this is your best bet.
See also
Of course it is also removed if you have a JSON Response in some Ajax call or you can redirect one, then all responses are removed. Not only render you can filter it through the request though.
In addition, I really suggest not to user tracking in Symphony. Tools like Piwik are a good API where you can create a good profile for users and track them. There is also a symphony bundle for Piwik, it is not sure whether it is still maintained or works
Comments
Post a Comment