function action() { $document_id = ''; // get period $p = $this->getPeriod(); // check for limits if ($this->getParam('document_id') || $this->getParam('pageUrl') || $this->getParam('pagePath')) { $doc = owa_coreAPI::entityFactory('base.document'); if ($this->getParam('pageUrl')) { $doc->getByColumn('url', $this->getParam('pageUrl')); } elseif ($this->getParam('pagePath')) { $doc->getByColumn('uri', $this->getParam('pagePath')); } else { $doc->load($this->getParam('document_id')); } $document_id = $doc->get('id'); $this->setTitle('Domstream Recordings: ', $doc->get('url')); $this->set('document', $doc->_getProperties()); $this->set('item_properties', $doc); } else { // latest domstream report $this->setTitle('Latest Domstreams'); } $ds = owa_coreAPI::executeApiCommand(array('do' => 'getDomstreams', 'startDate' => $p->getStartDate()->getYyyymmdd(), 'endDate' => $p->getEndDate()->getYyyymmdd(), 'document_id' => $document_id, 'siteId' => $this->getParam('siteId'), 'page' => $this->getParam('page'), 'resultsPerPage' => 50, 'format' => $this->getParam('format'))); $this->set('domstreams', $ds); //print_r($ds); // set view stuff $this->setSubview('base.reportDomstreams'); }
function action() { $s = owa_coreAPI::serviceSingleton(); // lookup method class $do = $s->getApiMethodClass($this->getParam('do')); if ($do) { // check credentials /* PERFORM AUTHENTICATION */ if (array_key_exists('required_capability', $do)) { /* CHECK USER FOR CAPABILITIES */ if (!owa_coreAPI::isCurrentUserCapable($do['required_capability'])) { // doesn't look like the currentuser has the necessary priviledges owa_coreAPI::debug('User does not have capability required by this controller.'); // auth user $auth =& owa_auth::get_instance(); $status = $auth->authenticateUser(); // if auth was not successful then return login view. if ($status['auth_status'] != true) { return 'This method requires authentication.'; } else { //check for needed capability again now that they are authenticated if (!owa_coreAPI::isCurrentUserCapable($do['required_capability'])) { return 'Your user does not have privileges to access this method.'; } } } } //perform $map = owa_coreAPI::getRequest()->getAllOwaParams(); echo owa_coreAPI::executeApiCommand($map); } }
function action() { $rs = owa_coreAPI::executeApiCommand(array('do' => 'getLatestVisits', 'siteId' => $this->getParam('siteId'), 'page' => $this->getParam('page'), 'startDate' => $this->getParam('startDate'), 'endDate' => $this->getParam('endDate'), 'period' => $this->getParam('period'), 'resultsPerPage' => 10)); $this->set('latest_visits', $rs); // view stuff $this->setView('base.report'); $this->setSubview('base.reportVisitors'); $this->setTitle('Visitors'); }
function action() { $gm = owa_coreAPI::supportClassFactory('base', 'goalManager', $this->getParam('siteId')); $goal_number = $this->getParam('goalNumber'); if (!$goal_number) { $goal_number = 1; } $goal = $gm->getGoal($goal_number); $funnel = $gm->getGoalFunnel($goal_number); if ($funnel) { $goal = $gm->getGoal($goal_number); // find required steps. build a constraint string. $required_step_constraints = ''; $steps_count = count($funnel); for ($i = 1; $i <= $steps_count; $i++) { if (array_key_exists('is_required', $funnel[$i]) && $funnel[$i]['is_required'] === true) { $required_step_constraints .= 'pagePath==' . $funnel[$i]['url'] . ','; } } $required_step_constraints = trim($required_step_constraints, ','); //print $required_step_constraints; // get total visits $total_visitors_rs = owa_coreAPI::executeApiCommand(array('period' => $this->get('period'), 'startDate' => $this->get('startDate'), 'endDate' => $this->get('endDate'), 'constraints' => $required_step_constraints, 'metrics' => 'visitors', 'do' => 'getResultSet', 'siteId' => $this->getParam('siteId'))); //print_r($total_visitors_rs); $total_visitors = $total_visitors_rs->getAggregateMetric('visitors'); //print "Total visits: $total_visitors"; $this->set('total_visitors', $total_visitors); // get visits for each step // add goal url to steps array $funnel[] = array('url' => $goal['details']['goal_url'], 'name' => $goal['goal_name'], 'step_number' => $steps_count + 1); foreach ($funnel as $k => $step) { $operator = '=='; $rs = owa_coreAPI::executeApiCommand(array('period' => $this->get('period'), 'startDate' => $this->get('startDate'), 'endDate' => $this->get('endDate'), 'metrics' => 'visitors', 'constraints' => 'pagePath' . $operator . $step['url'], 'do' => 'getResultSet', 'siteId' => $this->getParam('siteId'))); $visitors = $rs->getAggregateMetric('visitors') ? $rs->getAggregateMetric('visitors') : 0; $funnel[$k]['visitors'] = $visitors; // backfill check in case there are more visitors to this step than were at prior step. if ($funnel[$k]['visitors'] <= $funnel[$k - 1]['visitors']) { if ($funnel[$k - 1]['visitors'] > 0) { $funnel[$k]['visitor_percentage'] = round($funnel[$k]['visitors'] / $funnel[$k - 1]['visitors'], 4) * 100 . '%'; } else { $funnel[$k]['visitor_percentage'] = '0.00%'; } } else { $funnel[$k]['visitor_percentage'] = '100%'; } } //print_r($funnel); $goal_step = end($funnel); $goal_conversion_rate = round($goal_step['visitors'] / $total_visitors, 2) * 100 . '%'; $this->set('goal_conversion_rate', $goal_conversion_rate); $this->set('funnel', $funnel); } // set view stuff $this->setSubview('base.reportGoalFunnel'); $this->setTitle('Funnel Visualization:', 'Goal ' . $goal_number); $this->set('goal_number', $goal_number); }
function action() { $visit = owa_coreAPI::executeApiCommand(array('do' => 'getVisitDetail', 'sessionId' => $this->getParam('session_id'))); //setup Metrics $rs = owa_coreAPI::executeApiCommand(array('do' => 'getClickstream', 'sessionId' => $this->getParam('session_id'))); $this->set('clickstream', $rs); $this->set('visit', $visit); $this->set('session_id', $this->getParam('session_id')); $this->setView('base.report'); $this->setSubview('base.reportVisit'); $this->setTitle('Visit Clickstream'); }
function action() { $site_id = $this->getParam('siteId'); if ($site_id) { //get site labels $s = owa_coreAPI::entityFactory('base.site'); $s->getByColumn('site_id', $site_id); $this->set('site_name', $s->get('name')); $this->set('site_description', $s->get('description')); } $rs = owa_coreAPI::executeApiCommand(array('do' => 'getLatestVisits', 'siteId' => $this->getParam('siteId'), 'page' => $this->getParam('page'), 'startDate' => $this->getParam('startDate'), 'endDate' => $this->getParam('endDate'), 'period' => $this->getParam('period'), 'resultsPerPage' => 200)); $this->set('latest_visits', $rs); $this->set('site_id', $site_id); $this->setTitle('Visitor Geo-location'); $this->setView('base.report'); $this->setSubview('base.reportVisitsGeolocation'); }
function action() { // action counts $params = array('period' => $this->get('period'), 'startDate' => $this->get('startDate'), 'endDate' => $this->get('endDate'), 'metrics' => 'actions', 'dimensions' => 'actionName', 'siteId' => $this->getParam('siteId'), 'do' => 'getResultSet'); $rs = owa_coreAPI::executeApiCommand($params); //print_r($rs); $this->set('actions', $rs); $rs = owa_coreAPI::executeApiCommand(array('do' => 'getLatestVisits', 'siteId' => $this->getParam('siteId'), 'page' => $this->getParam('page'), 'startDate' => $this->getParam('startDate'), 'endDate' => $this->getParam('endDate'), 'period' => $this->getParam('period'), 'resultsPerPage' => 10)); $this->set('latest_visits', $rs); // set view stuff $this->setSubview('base.reportDashboard'); $this->setTitle('Dashboard'); $metrics = 'visits,uniqueVisitors,pageViews,bounceRate,pagesPerVisit,visitDuration'; if (owa_coreAPI::getSiteSetting($this->getParam('siteId'), 'enableEcommerceReporting')) { $metrics .= ',transactions,transactionRevenue'; } $this->set('metrics', $metrics); }
function action() { $visitorId = $this->getParam('visitorId'); if (!$visitorId) { $visitorId = $this->getParam('visitor_id'); } $v = owa_coreAPI::entityFactory('base.visitor'); $v->load($visitorId); if ($this->getParam('date')) { $startDate = $this->getParam('date'); $endDate = $this->getParam('date'); } $rs = owa_coreAPI::executeApiCommand(array('do' => 'getLatestVisits', 'visitorId' => $visitorId, 'siteId' => $this->getParam('siteId'), 'page' => $this->getParam('page'), 'startDate' => $startDate, 'endDate' => $endDate, 'format' => '')); $this->set('visits', $rs); $this->set('visitor', $v); $this->set('visitor_id', $visitorId); $this->setView('base.report'); $this->setSubview('base.reportVisits'); $this->setTitle('Visit History For: ', $v->getVisitorName()); }
function action() { $visitorId = $this->getParam('visitorId'); if (!$visitorId) { $visitorId = $this->getParam('visitor_id'); } $v = owa_coreAPI::entityFactory('base.visitor'); $v->load($visitorId); $lv = owa_coreAPI::executeApiCommand(array('do' => 'getLatestVisits', 'siteId' => $this->getParam('siteId'), 'page' => $this->getParam('page'), 'startDate' => $this->getParam('startDate'), 'endDate' => $this->getParam('endDate'), 'period' => $this->getParam('period'), 'visitorId' => $v->get('id'), 'resultsPerPage' => 10)); $this->set('visits', $lv); $this->set('visitor_label', $v->getVisitorName()); $first_visit_date = date('m/d/y', $v->get('first_session_timestamp')); $this->set('first_visit_date', $first_visit_date); $this->set('num_prior_visits', $v->get('num_prior_sessions')); $this->set('visitor_id', $visitorId); $this->set('visitor', $v); $this->set('visitor_avatar_id', $v->getAvatarId()); $this->setView('base.report'); $this->setSubview('base.reportVisitor'); $this->setTitle('Visitor History'); }
function action() { $map = owa_coreAPI::getRequest()->getAllOwaParams(); echo owa_coreAPI::executeApiCommand($map); }
function displayMetricInfobox($params = array()) { $t = new owa_template(); if (!empty($dom_id)) { $dom_id = rand(); } $params['do'] = 'getResultSet'; $count = owa_coreAPI::executeApiCommand($params); $params['period'] = 'last_thirty_days'; $params['dimensions'] = 'date'; $trend = owa_coreAPI::executeApiCommand($params); $t->set('metric_name', $params['metrics']); $t->set('dom_id', $dom_id); $t->set('count', $count); $t->set('trend', $trend); $t->set_template('metricInfobox.php'); return $t->fetch(); }
function getLatestActions($startDate, $endDate, $siteId, $visitorId = '', $sessionId = '', $width = '300px', $resultsPerPage = 25, $page = 1) { $la = owa_coreAPI::executeApiCommand(array('do' => 'getLatestActions', 'siteId' => $siteId, 'page' => $page, 'startDate' => $startDate, 'endDate' => $endDate, 'visitorId' => $visitorId, 'sessionId' => $sessionId, 'resultsPerPage' => $resultsPerPage)); $items = $la->getResultsRows(); $t = new owa_template(); $t->set('items', $items); $t->set('width', $width); $t->set_template('widget_latestActions.php'); return $t->fetch(); }