PHP 클래스 Piwik\Plugins\Live\API

The method "getLastVisitsDetails" will return extensive data for each visit, which includes: server time, visitId, visitorId, visitorType (new or returning), number of pages, list of all pages (and events, file downloaded and outlinks clicked), custom variables names and values set to this visit, number of goal conversions (and list of all Goal conversions for this visit, with time of conversion, revenue, URL, etc.), but also other attributes such as: days since last visit, days since first visit, country, continent, visitor IP, provider, referrer used (referrer name, keyword if it was a search engine, full URL), campaign name and keyword, operating system, browser, type of screen, resolution, supported browser plugins (flash, java, silverlight, pdf, etc.), various dates & times format to make it easier for API users... and more! With the parameter '&segment=' you can filter the returned visits by any criteria (visitor IP, visitor ID, country, keyword used, time of day, etc.). The method "getCounters" is used to return a simple counter: visits, number of actions, number of converted visits, in the last N minutes. See also the documentation about Real time widget and visitor level reports in Piwik.
상속: extends Piwik\Plugin\API
파일 보기 프로젝트 열기: piwik/piwik 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Psr\Log\LoggerInterface $logger )
getCounters ( integer $idSite, integer $lastMinutes, boolean | string $segment = false, array $showColumns = [], array $hideColumns = [] ) : array( This will return simple counters, for a given website ID, for visits over the last N minutes
getLastVisits ( $idSite, $filter_limit = 10, $minTimestamp = false )
getLastVisitsDetails ( integer $idSite, boolean | string $period = false, boolean | string $date = false, boolean | integer $segment = false, boolean | integer $countVisitorsToFetch = false, boolean | integer $minTimestamp = false, boolean $flat = false, boolean $doNotFetchActions = false ) : DataTable Returns the last visits tracked in the specified website You can define any number of filters: none, one, many or all parameters can be defined
getLastVisitsForVisitor ( integer $visitorId, integer $idSite, integer $filter_limit = 10, boolean $flat = false ) : DataTable The same functionality can be obtained using segment=visitorId==$visitorId with getLastVisitsDetails
getMostRecentVisitorId ( integer $idSite, boolean | string $segment = false ) : string Returns the visitor ID of the most recent visit.
getVisitorProfile ( integer $idSite, boolean | false | string $visitorId = false, boolean | false | string $segment = false, boolean | false | integer $limitVisits = false ) : array Returns an array describing a visitor using her last visits (uses a maximum of 100).

비공개 메소드들

메소드 설명
addFilterToCleanVisitors ( DataTable $dataTable, integer $idSite, boolean $flat = false, boolean $doNotFetchActions = false, boolean $filterNow = false ) For an array of visits, query the list of pages for this visit as well as make the data human readable
loadLastVisitorDetailsFromDatabase ( $idSite, $period, $date, $segment = false, $offset, $limit = 100, $minTimestamp = false, $filterSortOrder = false, $visitorId = false )
makeVisitorTableFromArray ( $data ) : DataTable
shouldColumnBePresentInResponse ( $column, $showColumns, $hideColumns )

메소드 상세

__construct() 공개 메소드

public __construct ( Psr\Log\LoggerInterface $logger )
$logger Psr\Log\LoggerInterface

getCounters() 공개 메소드

This will return simple counters, for a given website ID, for visits over the last N minutes
public getCounters ( integer $idSite, integer $lastMinutes, boolean | string $segment = false, array $showColumns = [], array $hideColumns = [] ) : array(
$idSite integer Id Site
$lastMinutes integer Number of minutes to look back at
$segment boolean | string
$showColumns array The columns to show / not to request. Eg 'visits', 'actions', ...
$hideColumns array The columns to hide / not to request. Eg 'visits', 'actions', ...
리턴 array(

getLastVisits() 공개 메소드

사용 중단:
public getLastVisits ( $idSite, $filter_limit = 10, $minTimestamp = false )

getLastVisitsDetails() 공개 메소드

Returns the last visits tracked in the specified website You can define any number of filters: none, one, many or all parameters can be defined
public getLastVisitsDetails ( integer $idSite, boolean | string $period = false, boolean | string $date = false, boolean | integer $segment = false, boolean | integer $countVisitorsToFetch = false, boolean | integer $minTimestamp = false, boolean $flat = false, boolean $doNotFetchActions = false ) : DataTable
$idSite integer Site ID
$period boolean | string Period to restrict to when looking at the logs
$date boolean | string Date to restrict to
$segment boolean | integer (optional) Number of visits rows to return
$countVisitorsToFetch boolean | integer DEPRECATED (optional) Only return the last X visits. Please use the API paramaeter 'filter_offset' and 'filter_limit' instead.
$minTimestamp boolean | integer (optional) Minimum timestamp to restrict the query to (useful when paginating or refreshing visits)
$flat boolean
$doNotFetchActions boolean
리턴 Piwik\DataTable

getLastVisitsForVisitor() 공개 메소드

The same functionality can be obtained using segment=visitorId==$visitorId with getLastVisitsDetails
사용 중단:
public getLastVisitsForVisitor ( integer $visitorId, integer $idSite, integer $filter_limit = 10, boolean $flat = false ) : DataTable
$visitorId integer
$idSite integer
$filter_limit integer
$flat boolean Whether to flatten the visitor details array
리턴 Piwik\DataTable

getMostRecentVisitorId() 공개 메소드

Returns the visitor ID of the most recent visit.
public getMostRecentVisitorId ( integer $idSite, boolean | string $segment = false ) : string
$idSite integer
$segment boolean | string
리턴 string

getVisitorProfile() 공개 메소드

Returns an array describing a visitor using her last visits (uses a maximum of 100).
public getVisitorProfile ( integer $idSite, boolean | false | string $visitorId = false, boolean | false | string $segment = false, boolean | false | integer $limitVisits = false ) : array
$idSite integer Site ID
$visitorId boolean | false | string The ID of the visitor whose profile to retrieve.
$segment boolean | false | string
$limitVisits boolean | false | integer
리턴 array