PHP Класс Piwik\Plugins\Referrers\API

For example, "getKeywords" returns all search engine keywords (with general analytics metrics for each keyword), "getWebsites" returns referrer websites (along with the full Referrer URL if the parameter &expanded=1 is set). "getReferrerType" returns the Referrer overview report. "getCampaigns" returns the list of all campaigns (and all campaign keywords if the parameter &expanded=1 is set). The methods "getKeywordsForPageUrl" and "getKeywordsForPageTitle" are used to output the top keywords used to find a page. Check out the widget "Top keywords used to find this page" that you can easily re-use on your website.
Наследование: extends Piwik\Plugin\API
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
getAll ( $idSite, $period, $date, $segment = false ) Returns a report that shows
getCampaigns ( $idSite, $period, $date, $segment = false, $expanded = false )
getCleanKeyword ( $label )
getKeywordNotDefinedString ( )
getKeywords ( $idSite, $period, $date, $segment = false, $expanded = false, $flat = false )
getKeywordsForPageTitle ( $idSite, $period, $date, $title )
getKeywordsForPageUrl ( $idSite, $period, $date, $url )
getKeywordsFromCampaignId ( $idSite, $period, $date, $idSubtable, $segment = false )
getKeywordsFromSearchEngineId ( $idSite, $period, $date, $idSubtable, $segment = false )
getNumberOfDistinctCampaigns ( $idSite, $period, $date, $segment = false )
getNumberOfDistinctKeywords ( $idSite, $period, $date, $segment = false )
getNumberOfDistinctSearchEngines ( $idSite, $period, $date, $segment = false )
getNumberOfDistinctWebsites ( $idSite, $period, $date, $segment = false )
getNumberOfDistinctWebsitesUrls ( $idSite, $period, $date, $segment = false )
getReferrerType ( string $idSite, string $period, string $date, boolean | string $segment = false, boolean | integer $typeReferrer = false, boolean | integer $idSubtable = false, boolean $expanded = false ) : DataTable Returns a report describing visit information for each possible referrer type. The result is a datatable whose subtables are the reports for each parent row's referrer type.
getSearchEngines ( $idSite, $period, $date, $segment = false, $expanded = false, $flat = false )
getSearchEnginesFromKeywordId ( $idSite, $period, $date, $idSubtable, $segment = false )
getSocials ( string $idSite, string $period, string $date, string | boolean $segment = false, boolean $expanded = false, boolean $flat = false ) : DataTable Returns report comparing the number of visits (and other info) for social network referrers.
getUrlsForSocial ( string $idSite, string $period, string $date, boolean | string $segment = false, boolean | integer $idSubtable = false ) : DataTable Returns report containing individual referrer URLs for a specific social networking site.
getUrlsFromWebsiteId ( $idSite, $period, $date, $idSubtable, $segment = false )
getWebsites ( $idSite, $period, $date, $segment = false, $expanded = false, $flat = false )

Защищенные методы

Метод Описание
getDataTable ( string $name, integer $idSite, string $period, string | Date $date, string $segment, boolean $expanded = false, integer | null $idSubtable = null ) : DataTable
getLabelsFromTable ( $table )

Приватные методы

Метод Описание
buildExpandedTableForFlattenGetSocials ( integer $idSite, string $period, string $date, string | false $segment, boolean $expanded, DataTable $dataTable )
filterOutKeywordNotDefined ( DataTable $table )
getNumeric ( $name, $idSite, $period, $date, $segment )
removeSubtableIds ( DataTable $table ) : DataTable Utility function that removes the subtable IDs for the subtables of the getReferrerType report. This avoids infinite recursion in said report (ie, the grandchildren of the report will be the original report, and it will recurse when trying to get a flat report).
removeSubtableMetadata ( DataTable $dataTable ) Removes idsubdatatable_in_db metadata from a DataTable. Used by Social tables since they use fake subtable IDs.
setSocialIdSubtables ( DataTable $dataTable ) Sets the subtable IDs for the DataTable returned by getSocial.

Описание методов

getAll() публичный Метод

Returns a report that shows
public getAll ( $idSite, $period, $date, $segment = false )

getCampaigns() публичный Метод

public getCampaigns ( $idSite, $period, $date, $segment = false, $expanded = false )

getCleanKeyword() публичный статический Метод

public static getCleanKeyword ( $label )

getDataTable() защищенный Метод

protected getDataTable ( string $name, integer $idSite, string $period, string | Date $date, string $segment, boolean $expanded = false, integer | null $idSubtable = null ) : DataTable
$name string
$idSite integer
$period string
$date string | Piwik\Date
$segment string
$expanded boolean
$idSubtable integer | null
Результат Piwik\DataTable

getKeywordNotDefinedString() публичный статический Метод

public static getKeywordNotDefinedString ( )

getKeywords() публичный Метод

public getKeywords ( $idSite, $period, $date, $segment = false, $expanded = false, $flat = false )

getKeywordsForPageTitle() публичный Метод

public getKeywordsForPageTitle ( $idSite, $period, $date, $title )

getKeywordsForPageUrl() публичный Метод

public getKeywordsForPageUrl ( $idSite, $period, $date, $url )

getKeywordsFromCampaignId() публичный Метод

public getKeywordsFromCampaignId ( $idSite, $period, $date, $idSubtable, $segment = false )

getKeywordsFromSearchEngineId() публичный Метод

public getKeywordsFromSearchEngineId ( $idSite, $period, $date, $idSubtable, $segment = false )

getLabelsFromTable() защищенный Метод

protected getLabelsFromTable ( $table )

getNumberOfDistinctCampaigns() публичный Метод

public getNumberOfDistinctCampaigns ( $idSite, $period, $date, $segment = false )

getNumberOfDistinctKeywords() публичный Метод

public getNumberOfDistinctKeywords ( $idSite, $period, $date, $segment = false )

getNumberOfDistinctSearchEngines() публичный Метод

public getNumberOfDistinctSearchEngines ( $idSite, $period, $date, $segment = false )

getNumberOfDistinctWebsites() публичный Метод

public getNumberOfDistinctWebsites ( $idSite, $period, $date, $segment = false )

getNumberOfDistinctWebsitesUrls() публичный Метод

public getNumberOfDistinctWebsitesUrls ( $idSite, $period, $date, $segment = false )

getReferrerType() публичный Метод

The subtable reports are: 'getKeywords' (for search engine referrer type), 'getWebsites', and 'getCampaigns'.
public getReferrerType ( string $idSite, string $period, string $date, boolean | string $segment = false, boolean | integer $typeReferrer = false, boolean | integer $idSubtable = false, boolean $expanded = false ) : DataTable
$idSite string The site ID.
$period string The period to get data for, either 'day', 'week', 'month', 'year', or 'range'.
$date string The date of the period.
$segment boolean | string The segment to use.
$typeReferrer boolean | integer (deprecated) If you want to get data only for a specific referrer type, supply a type for this parameter.
$idSubtable boolean | integer For this report this value is a referrer type ID and not an actual subtable ID. The result when using this parameter will be the specific report for the given referrer type.
$expanded boolean Whether to get report w/ subtables loaded or not.
Результат Piwik\DataTable

getSearchEngines() публичный Метод

public getSearchEngines ( $idSite, $period, $date, $segment = false, $expanded = false, $flat = false )

getSearchEnginesFromKeywordId() публичный Метод

public getSearchEnginesFromKeywordId ( $idSite, $period, $date, $idSubtable, $segment = false )

getSocials() публичный Метод

This is a view of the getWebsites report.
public getSocials ( string $idSite, string $period, string $date, string | boolean $segment = false, boolean $expanded = false, boolean $flat = false ) : DataTable
$idSite string
$period string
$date string
$segment string | boolean
$expanded boolean
$flat boolean
Результат Piwik\DataTable

getUrlsForSocial() публичный Метод

Returns report containing individual referrer URLs for a specific social networking site.
public getUrlsForSocial ( string $idSite, string $period, string $date, boolean | string $segment = false, boolean | integer $idSubtable = false ) : DataTable
$idSite string
$period string
$date string
$segment boolean | string
$idSubtable boolean | integer This ID does not reference a real DataTable record. Instead, it is the array index of an item in the Socials list file. The urls are filtered by the social network at this index. If false, no filtering is done and every social URL is returned.
Результат Piwik\DataTable

getUrlsFromWebsiteId() публичный Метод

public getUrlsFromWebsiteId ( $idSite, $period, $date, $idSubtable, $segment = false )

getWebsites() публичный Метод

public getWebsites ( $idSite, $period, $date, $segment = false, $expanded = false, $flat = false )