Functions

Function Description
getAccounts Returns a list of all the accounts the authenticated user has access to.
getData Returns analytics data.
getProperties Returns web properties for a given account (or all accounts).
getProfiles Returns views/profiles for a given account (or all accounts) and web property (or all web profiles).
cacheInformation Retrieves analytics information for each BigTree page and saves it in bigtree_pages for fast reference later.

getAccounts

Returns a list of all the accounts the authenticated user has access to.

Return Value: A BigTreeGoogleResultSet of BigTreeGoogleAnalyticsAccount objects.

getAccounts($params)
Parameter Description
$params Additional parameters to pass to the API call.

getData

Returns analytics data.
For more information on metrics and dimensions, see: https://developers.google.com/analytics/devguides/reporting/core/dimsmets

Return Value: An array of data.

getData($profile, $start_date, $end_date, $metrics, $dimensions = "", $sort = "", $results = 10000)
Parameter Description
$profile Profile ID
$start_date Date to begin analytics data report (in a format strtotime understands)
$end_date Date to end analytics data report (in a format strtotime understands)
$metrics Array of metrics or a single metric as a string (with or without ga:)
$dimensions Optional array of dimensions or a single dimension as a string (with or without ga:)
$sort Optional metric or dimension to sort by (with or without ga:), optional
$results Maximum number of results (defaults to 10,000 which is the maximum)

getProperties

Returns web properties for a given account (or all accounts).

Return Value: A BigTreeGoogleResultSet of BigTreeGoogleAnalyticsProperty objects.

getProperties($account, $params)
Parameter Description
$account Account ID (or "~all" for all accounts which is the default)
$params Additional parameters to pass to the API call.

getProfiles

Returns views/profiles for a given account (or all accounts) and web property (or all web profiles).

Return Value: A BigTreeGoogleResultSet of BigTreeGoogleAnalyticsProfile objects.

getProfiles($account, $property, $params)
Parameter Description
$account Account ID (or "~all" for all accounts which is the default)
$property Web Property ID (or "~all" for all profiles which is the default)
$params Additional parameters to pass to the API call.

cacheInformation

Retrieves analytics information for each BigTree page and saves it in bigtree_pages for fast reference later.
Also retrieves heads up views and stores them in settings for quick retrieval. Should be called every 24 hours to refresh.

cacheInformation()