protected function configureSegments()
 {
     parent::configureSegments();
     $segment = new Segment();
     $segment->setType('dimension');
     $segment->setCategory(Piwik::translate('General_Visit'));
     $segment->setName('General_VisitorID');
     $segment->setSegment('visitorId');
     $segment->setAcceptedValues('34c31e04394bdc63 - any 16 Hexadecimal chars ID, which can be fetched using the Tracking API function getVisitorId()');
     $segment->setSqlSegment('log_visit.idvisitor');
     $segment->setSqlFilterValue(array('Piwik\\Common', 'convertVisitorIdToBin'));
     $segment->setRequiresAtLeastViewAccess(true);
     $this->addSegment($segment);
 }
Exemple #2
0
 protected function configureSegments()
 {
     parent::configureSegments();
     $segment = new Segment();
     $segment->setType('metric');
     $segment->setCategory(Piwik::translate('General_Visit'));
     $segment->setName('General_VisitorIP');
     $segment->setSegment('visitIp');
     $segment->setAcceptedValues('13.54.122.1. </code>Select IP ranges with notation: <code>visitIp>13.54.122.0;visitIp<13.54.122.255');
     $segment->setSqlSegment('log_visit.location_ip');
     $segment->setSqlFilterValue(array('Piwik\\Network\\IPUtils', 'stringToBinaryIP'));
     $segment->setRequiresAtLeastViewAccess(true);
     $this->addSegment($segment);
 }