Skip to content

Commit

Permalink
new endpoints
Browse files Browse the repository at this point in the history
if we need to do anything else we will need to pass in key
  • Loading branch information
Mike committed Sep 26, 2012
1 parent bd6a6f7 commit 2b1f688
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/model/GoogleAnalytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ public function call($url) {
public function load_accounts() {
//---------------------------------------------------------------------------------------------

$xml = $this->call('https://www.google.com/analytics/feeds/accounts/default');

$xml = $this->call('https://www.googleapis.com/analytics/v2.4/management/accounts');
$dom = new DOMDocument();
$dom->loadXML($xml);

Expand Down Expand Up @@ -179,7 +178,7 @@ public function data($id, $dimension, $metric, $sort = false, $start = false, $e
if(!$sort) $sort = "-$metric";
if(!$start) $start = date('Y-m-d', strtotime('1 month ago'));
if(!$end) $end = date('Y-m-d', strtotime('yesterday'));
$string = "https://www.google.com/analytics/feeds/data?ids=ga:$id&dimensions=$dimension&metrics=$metric&sort=$sort&start-date=$start&end-date=$end&max-results=$max_results&start-index=$start_index";
$string = "https://www.googleapis.com/analytics/v2.4/data?ids=ga:$id&dimensions=$dimension&metrics=$metric&sort=$sort&start-date=$start&end-date=$end&max-results=$max_results&start-index=$start_index";
$xml = $this->call($string);
if(!$xml) {
return false;
Expand Down

0 comments on commit 2b1f688

Please sign in to comment.