/** Get data from the api to list activities
  * @access public
  */
 public function activitiesAction()
 {
     $analytics = new Pas_Analytics_Gateway($this->_ID, $this->_pword);
     $analytics->setProfile(25726058);
     $timeframe = new Pas_Analytics_Timespan();
     $timeframe->setTimespan($this->getParam('timespan'));
     $dates = $timeframe->getDates();
     $analytics->setStart($dates['start']);
     $analytics->setEnd($dates['end']);
     $analytics->setMetrics(array(Zend_Gdata_Analytics_DataQuery::METRIC_SOCIAL_ACTIVITIES));
     $analytics->setDimensions(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_SOCIAL_ACTIVITY_CONTENT_URL, Zend_Gdata_Analytics_DataQuery::DIMENSION_SOCIAL_ACTIVITY_POST, Zend_Gdata_Analytics_DataQuery::DIMENSION_SOCIAL_ACTIVITY_NETWORK_ACTION, Zend_Gdata_Analytics_DataQuery::DIMENSION_SOCIAL_ACTIVITY_DISPLAY_NAME, Zend_Gdata_Analytics_DataQuery::DIMENSION_SOCIAL_ACTIVITY_ENDORSING_URL));
     $analytics->setMax(500);
     $analytics->setSort(Zend_Gdata_Analytics_DataQuery::METRIC_SOCIAL_ACTIVITIES);
     $analytics->setSortDirection(true);
     $this->view->results = $analytics->getData();
 }
 /** Discover an overview
  * @access public
  */
 public function overviewAction()
 {
     $analytics = new Pas_Analytics_Gateway($this->_ID, $this->_pword);
     $analytics->setProfile(25726058);
     $timeframe = new Pas_Analytics_Timespan();
     $timeframe->setTimespan($this->getParam('timespan'));
     $dates = $timeframe->getDates();
     $analytics->setStart($dates['start']);
     $analytics->setEnd($dates['end']);
     $analytics->setMetrics(array(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS, Zend_Gdata_Analytics_DataQuery::METRIC_VISITS, Zend_Gdata_Analytics_DataQuery::METRIC_PAGEVIEWS, Zend_Gdata_Analytics_DataQuery::METRIC_BOUNCES, Zend_Gdata_Analytics_DataQuery::METRIC_AVG_TIME_ON_SITE));
     $analytics->setDimensions(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_MEDIUM));
     $analytics->setMax(500);
     $analytics->setSort(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS);
     $analytics->setSortDirection(true);
     $this->view->results = $analytics->getData();
 }
 /** Get the data from Google's api
  * @access public
  * @return \Pas_View_Helper_GaContentNextPage
  */
 public function getGaData()
 {
     $analytics = new Pas_Analytics_Gateway($this->getId(), $this->getPassword());
     $analytics->setProfile($this->getProfile());
     $timeframe = new Pas_Analytics_Timespan($this->getTimeSpan());
     $dates = $timeframe->getDates();
     $analytics->setStart($dates['start']);
     $analytics->setEnd($dates['end']);
     $analytics->setMetrics(array(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS, Zend_Gdata_Analytics_DataQuery::METRIC_PAGEVIEWS, Zend_Gdata_Analytics_DataQuery::METRIC_UNIQUE_PAGEVIEWS, Zend_Gdata_Analytics_DataQuery::METRIC_AVG_TIME_ON_PAGE, Zend_Gdata_Analytics_DataQuery::METRIC_ENTRANCES));
     $analytics->setDimensions(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_NEXT_PAGE_PATH, Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH, Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_TITLE));
     $analytics->setFilters(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH . Zend_Gdata_Analytics_DataQuery::REGULAR_NOT . 'forum', Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH . Zend_Gdata_Analytics_DataQuery::EQUALS . $this->_path));
     $analytics->setMax($this->_limit);
     $analytics->setSort(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS);
     $analytics->setSortDirection(true);
     $this->_results = $analytics->getData();
     return $this;
 }
 /** Find out about OS and browser combos
  * @access public
  */
 public function ostobrowserAction()
 {
     $analytics = new Pas_Analytics_Gateway($this->_ID, $this->_pword);
     $analytics->setProfile(25726058);
     $timeframe = new Pas_Analytics_Timespan();
     $timeframe->setTimespan($this->getParam('timespan'));
     $dates = $timeframe->getDates();
     $analytics->setStart($dates['start']);
     $analytics->setEnd($dates['end']);
     $analytics->setMetrics(array(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS, Zend_Gdata_Analytics_DataQuery::METRIC_VISITS, Zend_Gdata_Analytics_DataQuery::METRIC_AVG_TIME_ON_SITE, Zend_Gdata_Analytics_DataQuery::METRIC_BOUNCES));
     $analytics->setDimensions(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_OPERATING_SYSTEM, Zend_Gdata_Analytics_DataQuery::DIMENSION_BROWSER));
     $analytics->setFilters(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_IS_MOBILE . Zend_Gdata_Analytics_DataQuery::EQUALS_NOT . 'Yes'));
     $analytics->setMax(500);
     $analytics->setSort(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS);
     $analytics->setSortDirection(true);
     $this->view->results = $analytics->getData();
 }
 /** The page query
  * @access public
  * @throws Pas_Analytics_Exception
  */
 public function pageAction()
 {
     $analytics = new Pas_Analytics_Gateway($this->_ID, $this->_pword);
     $analytics->setProfile(25726058);
     $timeframe = new Pas_Analytics_Timespan();
     $timeframe->setTimespan($this->getParam('timespan'));
     $dates = $timeframe->getDates();
     $analytics->setStart($dates['start']);
     $analytics->setEnd($dates['end']);
     $analytics->setMetrics(array(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS, Zend_Gdata_Analytics_DataQuery::METRIC_PAGEVIEWS, Zend_Gdata_Analytics_DataQuery::METRIC_UNIQUE_PAGEVIEWS, Zend_Gdata_Analytics_DataQuery::METRIC_AVG_TIME_ON_PAGE, Zend_Gdata_Analytics_DataQuery::METRIC_ENTRANCES, Zend_Gdata_Analytics_DataQuery::METRIC_EXIT_RATE, Zend_Gdata_Analytics_DataQuery::METRIC_BOUNCES));
     $analytics->setDimensions(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_TITLE, Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH));
     if (is_null($this->getParam('url'))) {
         throw new Pas_Analytics_Exception('A path must be set');
     } else {
         $analytics->setFilters(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH . Zend_Gdata_Analytics_DataQuery::EQUALS . base64_decode(rawurldecode($this->getParam('url')))));
     }
     $analytics->setMax(20);
     $analytics->setSort(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS);
     $analytics->setSortDirection(true);
     $this->view->results = $analytics->getData();
     $this->view->total = (int) $analytics->getTotal();
     $this->view->path = $this->getParam('url');
 }
 /** Get the data from google's api
  * @access public
  * @return \Pas_View_Helper_GaContentMetrics
  */
 public function getGaData()
 {
     $analytics = new Pas_Analytics_Gateway($this->getId(), $this->getPassword());
     $analytics->setProfile($this->getProfile());
     $timeframe = new Pas_Analytics_Timespan($this->getTimeSpan());
     $dates = $timeframe->getDates();
     $analytics->setStart($dates['start']);
     $analytics->setEnd($dates['end']);
     $analytics->setMetrics(array(Zend_Gdata_Analytics_DataQuery::METRIC_SPEED_AVG_PAGE_LOAD_TIME, Zend_Gdata_Analytics_DataQuery::METRIC_SPEED_METRICS_SAMPLE));
     $analytics->setDimensions(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH));
     $analytics->setFilters(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH . Zend_Gdata_Analytics_DataQuery::EQUALS . $this->_path));
     $analytics->setMax($this->getLimit());
     $analytics->setSort(Zend_Gdata_Analytics_DataQuery::METRIC_SPEED_AVG_PAGE_LOAD_TIME);
     $analytics->setSortDirection(true);
     $this->_results = $analytics->getData();
     $this->_total = $analytics->getTotal();
     return $this;
 }
 /** Get the number of page visitors
  * @access public
  * @throws Pas_Analytics_Exception
  */
 public function pagevisitorsAction()
 {
     $analytics = new Pas_Analytics_Gateway($this->_id, $this->_pword);
     $analytics->setProfile(25726058);
     $timeframe = new Pas_Analytics_Timespan();
     $timeframe->setTimespan($this->getParam('timespan'));
     $dates = $timeframe->getDates();
     $analytics->setStart($dates['start']);
     $analytics->setEnd($dates['end']);
     $analytics->setMetrics(array(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS));
     $analytics->setDimensions(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_LATITUDE, Zend_Gdata_Analytics_DataQuery::DIMENSION_LONGITUDE));
     if (is_null($this->getParam('url'))) {
         throw new Pas_Analytics_Exception('A path must be set');
     } else {
         $analytics->setFilters(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH . Zend_Gdata_Analytics_DataQuery::EQUALS . base64_decode(rawurldecode($this->getParam('url')))));
     }
     $analytics->setMax(100);
     $analytics->setSort(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS);
     $analytics->setSortDirection(true);
     $this->view->results = $analytics->getData();
 }
 /** Get data from the api
  * @access public
  * @return \Pas_View_Helper_GaContentSearch
  */
 public function getGaData()
 {
     $analytics = new Pas_Analytics_Gateway($this->getId(), $this->getPassword());
     $analytics->setProfile($this->getProfile());
     $timeframe = new Pas_Analytics_Timespan($this->getTimeSpan());
     $dates = $timeframe->getDates();
     $analytics->setStart($dates['start']);
     $analytics->setEnd($dates['end']);
     $analytics->setMetrics(array(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS, Zend_Gdata_Analytics_DataQuery::METRIC_PAGEVIEWS, Zend_Gdata_Analytics_DataQuery::METRIC_UNIQUE_PAGEVIEWS, Zend_Gdata_Analytics_DataQuery::METRIC_AVG_TIME_ON_PAGE, Zend_Gdata_Analytics_DataQuery::METRIC_ENTRANCES));
     $analytics->setDimensions(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_KEYWORD, Zend_Gdata_Analytics_DataQuery::DIMENSION_SOURCE));
     $analytics->setFilters(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_KEYWORD . Zend_Gdata_Analytics_DataQuery::REGULAR_NOT . '(not set)', Zend_Gdata_Analytics_DataQuery::DIMENSION_KEYWORD . Zend_Gdata_Analytics_DataQuery::REGULAR_NOT . '(not provided)', Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH . Zend_Gdata_Analytics_DataQuery::REGULAR . $this->getPath()));
     $analytics->setMax($this->getLimit());
     $analytics->setSort(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS);
     $analytics->setSortDirection(true);
     $this->_results = $analytics->getData();
     $this->_total = $analytics->getTotal();
     return $this;
 }
 /** The tablets interaction action
  * @access public
  */
 public function tabletsAction()
 {
     $analytics = new Pas_Analytics_Gateway($this->_ID, $this->_pword);
     $analytics->setProfile(25726058);
     $timeframe = new Pas_Analytics_Timespan();
     $timeframe->setTimespan($this->getParam('timespan'));
     $dates = $timeframe->getDates();
     $analytics->setStart($dates['start']);
     $analytics->setEnd($dates['end']);
     $analytics->setMetrics(array(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS, Zend_Gdata_Analytics_DataQuery::METRIC_VISITS, Zend_Gdata_Analytics_DataQuery::METRIC_AVG_TIME_ON_SITE));
     $analytics->setDimensions(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_OPERATING_SYSTEM, Zend_Gdata_Analytics_DataQuery::DIMENSION_MOBILE_DEVICE_BRANDING));
     $analytics->setMax(500);
     $analytics->setSort(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS);
     if ($this->getParam('network', false)) {
         $analytics->setFilters(array(Zend_Gdata_Analytics_DataQuery::DIMENSION_SOCIAL_NETWORK . Zend_Gdata_Analytics_DataQuery::EQUALS . $this->getParam('network')));
     }
     $analytics->setSegment(13);
     $analytics->setSortDirection(true);
     $this->view->results = $analytics->getData();
 }