Piwik\Tracker\Visit::handleNewVisit PHP Method

handleNewVisit() protected method

1) Insert the new action 2) Insert the visit information
protected handleNewVisit ( boolean $visitIsConverted )
$visitIsConverted boolean
    protected function handleNewVisit($visitIsConverted)
    {
        Common::printDebug("New Visit (IP = " . IPUtils::binaryToStringIP($this->getVisitorIp()) . ")");
        $this->setNewVisitorInformation();
        $dimensions = $this->getAllVisitDimensions();
        $this->triggerHookOnDimensions($dimensions, 'onNewVisit');
        if ($visitIsConverted) {
            $this->triggerHookOnDimensions($dimensions, 'onConvertedVisit');
        }
        foreach ($this->requestProcessors as $processor) {
            $processor->onNewVisit($this->visitProperties, $this->request);
        }
        $this->printVisitorInformation();
        $idVisit = $this->insertNewVisit($this->visitProperties->getProperties());
        $this->visitProperties->setProperty('idvisit', $idVisit);
        $this->visitProperties->setProperty('visit_first_action_time', $this->request->getCurrentTimestamp());
        $this->visitProperties->setProperty('visit_last_action_time', $this->request->getCurrentTimestamp());
    }

Usage Example

 public function handleNewVisit($visitor, $action, $visitIsConverted)
 {
     parent::handleNewVisit($visitor, $action, $visitIsConverted);
 }