PHP Class Backend\Modules\Analytics\GoogleClient\Connector

Show file Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
__construct ( Google_Service_Analytics $analytics, Psr\Cache\CacheItemPoolInterface $cache, ModulesSettings $settings )
getBounceRate ( integer $startDate, integer $endDate ) : float Returns the bounce rate in a certain period
getMostVisitedPagesData ( integer $startDate, integer $endDate ) : array Returns the source graph data
getNewSessionsPercentage ( integer $startDate, integer $endDate ) : float Returns the percentage of new sessions in a certain period
getPageViews ( integer $startDate, integer $endDate ) : integer Returns the amount of pageviews in a period
getPagesPerVisit ( integer $startDate, integer $endDate ) : float Returns the amount of pages per visit in a period
getSourceGraphData ( integer $startDate, integer $endDate ) : array Returns the source graph data
getTimeOnSite ( integer $startDate, integer $endDate ) : float Returns the average time on the site in a certain period
getVisitors ( integer $startDate, integer $endDate ) : integer Returns the amount of visitors in a period
getVisitorsGraphData ( integer $startDate, integer $endDate ) : array Returns the visitors graph data

Private Methods

Method Description
collectMostVisitedPagesData ( integer $startDate, integer $endDate ) : array Fetches the data needed to build the list with most visited pages
collectSourceGraphData ( integer $startDate, integer $endDate ) : array Fetches the data needed to build the source graph for a date range
collectVisitGraphData ( integer $startDate, integer $endDate ) : array Fetches the data needed to build the visitors graph for a date range
getAnalyticsData ( integer $startDate, integer $endDate, string $metrics, array $optParams = [] ) : Google_Service_Analytics_GaData Returns Analytics data for our coupled profile
getData ( integer $startDate, integer $endDate ) : array Fetches all the needed data and caches it in our statistics array
getMetrics ( integer $startDate, integer $endDate ) : array Fetches some metrics for a certain date range

Method Details

__construct() public method

public __construct ( Google_Service_Analytics $analytics, Psr\Cache\CacheItemPoolInterface $cache, ModulesSettings $settings )
$analytics Google_Service_Analytics
$cache Psr\Cache\CacheItemPoolInterface
$settings common\ModulesSettings

getBounceRate() public method

Returns the bounce rate in a certain period
public getBounceRate ( integer $startDate, integer $endDate ) : float
$startDate integer
$endDate integer
return float

getMostVisitedPagesData() public method

Returns the source graph data
public getMostVisitedPagesData ( integer $startDate, integer $endDate ) : array
$startDate integer
$endDate integer
return array

getNewSessionsPercentage() public method

Returns the percentage of new sessions in a certain period
public getNewSessionsPercentage ( integer $startDate, integer $endDate ) : float
$startDate integer
$endDate integer
return float

getPageViews() public method

Returns the amount of pageviews in a period
public getPageViews ( integer $startDate, integer $endDate ) : integer
$startDate integer
$endDate integer
return integer

getPagesPerVisit() public method

Returns the amount of pages per visit in a period
public getPagesPerVisit ( integer $startDate, integer $endDate ) : float
$startDate integer
$endDate integer
return float

getSourceGraphData() public method

Returns the source graph data
public getSourceGraphData ( integer $startDate, integer $endDate ) : array
$startDate integer
$endDate integer
return array

getTimeOnSite() public method

Returns the average time on the site in a certain period
public getTimeOnSite ( integer $startDate, integer $endDate ) : float
$startDate integer
$endDate integer
return float

getVisitors() public method

Returns the amount of visitors in a period
public getVisitors ( integer $startDate, integer $endDate ) : integer
$startDate integer
$endDate integer
return integer

getVisitorsGraphData() public method

Returns the visitors graph data
public getVisitorsGraphData ( integer $startDate, integer $endDate ) : array
$startDate integer
$endDate integer
return array