getSiteConfig() public static method

public static getSiteConfig ( null $site = null ) : boolean
$site null
return boolean
 public function dataExplorerAction()
 {
     $config = Google\Analytics::getSiteConfig($this->getSite());
     $startDate = date("Y-m-d", time() - 86400 * 31);
     $endDate = date("Y-m-d");
     $metric = "ga:pageviews";
     $dimension = "ga:date";
     $descending = true;
     $limit = 10;
     if ($this->getParam("dateFrom") && $this->getParam("dateTo")) {
         $startDate = date("Y-m-d", strtotime($this->getParam("dateFrom")));
         $endDate = date("Y-m-d", strtotime($this->getParam("dateTo")));
     }
     if ($this->getParam("dimension")) {
         $dimension = $this->getParam("dimension");
     }
     if ($this->getParam("metric")) {
         $metric = $this->getParam("metric");
     }
     if ($this->getParam("sort")) {
         if ($this->getParam("sort") == "asc") {
             $descending = false;
         }
     }
     if ($this->getParam("limit")) {
         $limit = $this->getParam("limit");
     }
     if ($filterPath = $this->getFilterPath()) {
         $filters[] = "ga:pagePath==" . $filterPath;
     }
     $opts = ["dimensions" => $dimension, "max-results" => $limit, "sort" => ($descending ? "-" : "") . $metric];
     if (!empty($filters)) {
         $opts["filters"] = implode(";", $filters);
     }
     $result = $this->service->data_ga->get("ga:" . $config->profile, $startDate, $endDate, $metric, $opts);
     $data = [];
     foreach ($result["rows"] as $row) {
         $data[] = ["dimension" => $this->formatDimension($dimension, $row[0]), "metric" => (double) $row[1]];
     }
     $this->_helper->json(["data" => $data]);
 }
 public function navigationAction()
 {
     $config = Google\Analytics::getSiteConfig($this->getSite());
     $startDate = date("Y-m-d", time() - 86400 * 31);
     $endDate = date("Y-m-d");
     if ($this->getParam("dateFrom") && $this->getParam("dateTo")) {
         $startDate = date("Y-m-d", strtotime($this->getParam("dateFrom")));
         $endDate = date("Y-m-d", strtotime($this->getParam("dateTo")));
     }
     // all pageviews
     if ($filterPath = $this->getFilterPath()) {
         $filters[] = "ga:pagePath==" . $filterPath;
     }
     $opts = array("dimensions" => "ga:pagePath", "max-results" => 1, "sort" => "-ga:pageViews");
     if (!empty($filters)) {
         $opts["filters"] = implode(";", $filters);
     }
     $result0 = $this->service->data_ga->get("ga:" . $config->profile, $startDate, $endDate, "ga:pageViews", $opts);
     $totalViews = (int) $result0["totalsForAllResults"]["ga:pageViews"];
     // ENTRANCES
     $opts = array("dimensions" => "ga:previousPagePath", "max-results" => 10, "sort" => "-ga:pageViews");
     if (!empty($filters)) {
         $opts["filters"] = implode(";", $filters);
     }
     $result1 = $this->service->data_ga->get("ga:" . $config->profile, $startDate, $endDate, "ga:pageViews", $opts);
     $prev = array();
     foreach ($result1["rows"] as $row) {
         $d = array("path" => $this->formatDimension("ga:previousPagePath", $row[0]), "pageviews" => $row[1]);
         $document = Document::getByPath($row[0]);
         if ($document) {
             $d["id"] = $document->getId();
         }
         $d["percent"] = round($d["pageviews"] / $totalViews * 100);
         $d["weight"] = 100;
         if ($prev[0]["weight"]) {
             $d["weight"] = round($d["percent"] / $prev[0]["percent"] * 100);
         }
         $prev[] = $d;
     }
     // EXITS
     $opts = array("dimensions" => "ga:pagePath", "max-results" => 10, "sort" => "-ga:pageViews");
     if (!empty($filters)) {
         $opts["filters"] = implode(";", $filters);
     }
     $result2 = $this->service->data_ga->get("ga:" . $config->profile, $startDate, $endDate, "ga:pageViews", $opts);
     $next = array();
     foreach ($result2["rows"] as $row) {
         $d = array("path" => $this->formatDimension("ga:previousPagePath", $row[0]), "pageviews" => $row[1]);
         $document = Document::getByPath($row[0]);
         if ($document) {
             $d["id"] = $document->getId();
         }
         $d["percent"] = round($d["pageviews"] / $totalViews * 100);
         $d["weight"] = 100;
         if ($next[0]["weight"]) {
             $d["weight"] = round($d["percent"] / $next[0]["percent"] * 100);
         }
         $next[] = $d;
     }
     $this->view->next = $next;
     $this->view->prev = $prev;
     $this->view->path = $this->getFilterPath();
     $this->getResponse()->setHeader("Content-Type", "application/xml", true);
 }