PHP Class 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.
Inheritance: extends Piwik\Plugin\API
Afficher le fichier Open project: piwik/piwik Class Usage Examples

Méthodes publiques

Méthode Description
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 )

Méthodes protégées

Méthode Description
getDataTable ( string $name, integer $idSite, string $period, string | Date $date, string $segment, boolean $expanded = false, integer | null $idSubtable = null ) : DataTable
getLabelsFromTable ( $table )

Private Methods

Méthode Description
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.

Method Details

getAll() public méthode

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

getCampaigns() public méthode

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

getCleanKeyword() public static méthode

public static getCleanKeyword ( $label )

getDataTable() protected méthode

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
Résultat Piwik\DataTable

getKeywordNotDefinedString() public static méthode

public static getKeywordNotDefinedString ( )

getKeywords() public méthode

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

getKeywordsForPageTitle() public méthode

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

getKeywordsForPageUrl() public méthode

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

getKeywordsFromCampaignId() public méthode

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

getKeywordsFromSearchEngineId() public méthode

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

getLabelsFromTable() protected méthode

protected getLabelsFromTable ( $table )

getNumberOfDistinctCampaigns() public méthode

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

getNumberOfDistinctKeywords() public méthode

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

getNumberOfDistinctSearchEngines() public méthode

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

getNumberOfDistinctWebsites() public méthode

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

getNumberOfDistinctWebsitesUrls() public méthode

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

getReferrerType() public méthode

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.
Résultat Piwik\DataTable

getSearchEngines() public méthode

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

getSearchEnginesFromKeywordId() public méthode

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

getSocials() public méthode

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
Résultat Piwik\DataTable

getUrlsForSocial() public méthode

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.
Résultat Piwik\DataTable

getUrlsFromWebsiteId() public méthode

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

getWebsites() public méthode

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