I am trying to create a function doing something when a new visit happens. If I use the newVisitorInformation hook, it records stuff but that is only when a new visitor comes for the first time, not when he returns (correct?). So, trying to use getNewVisitObject instead:
Then when I read it from DB, it is "null".
In the Piwik source https://github.com/piwik/piwik/blob/1.0/core/Tracker.php#L237 , we have:
- looks like it deliberately passes "null" to the hook. Why, and how can I get a visit's info?
public function getNewVisitObject($notification) { $visit =& $notification->getNotificationObject(); $raw_data = serialize($visit); ... record into DB...
Then when I read it from DB, it is "null".
In the Piwik source https://github.com/piwik/piwik/blob/1.0/core/Tracker.php#L237 , we have:
$visit = null; Piwik_PostEvent('Tracker.getNewVisitObject', $visit);
- looks like it deliberately passes "null" to the hook. Why, and how can I get a visit's info?