function __construct()
 {
     $this->setName('repeatVisitors');
     $this->setLabel('Repeat Visitors');
     $this->setEntity('base.session');
     $this->setSelect("(count(distinct(session.visitor_id)) - sum(CASE session.is_new_visitor WHEN CONVERT(bit,'true') THEN 1 ELSE 0 END))");
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('visitDuration');
     $this->setLabel('Avg. Visit Duration');
     $this->setEntity('base.session');
     $this->setSelect(sprintf("round(avg(%s.last_req - %s.timestamp))", $this->entity->getTableAlias(), $this->entity->getTableAlias()));
     $this->setDataType('timestamp');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('domClicks');
     $this->setLabel('Dom Clicks');
     $this->setEntity('base.click');
     $this->setColumn('id');
     $this->setSelect(sprintf("count(%s)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('newVisitors');
     $this->setLabel('New Visitors');
     $this->setEntity('base.session');
     $this->setColumn('is_new_visitor');
     $this->setSelect(sprintf("sum(CASE %s WHEN TRUE THEN 1 ELSE 0 END)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('pageViews');
     $this->setLabel('Page Views');
     $this->setEntity('base.session');
     $this->setColumn('num_pageviews');
     $this->setSelect(sprintf("SUM(%s)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('goalValueAll');
     $this->setLabel('All Goals Value');
     $this->setEntity('base.session');
     $this->setColumn('goals_value');
     $this->setSelect(sprintf("SUM(%s)", $this->getColumn()));
     $this->setDataType('currency');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('uniqueLineItems');
     $this->setLabel('Unique Items');
     $this->setEntity('base.commerce_transaction_fact');
     $this->setColumn('sku');
     $this->setSelect(sprintf("count(distinct %s)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('actionsValue');
     $this->setLabel('Actions Value');
     $this->setEntity('base.action_fact');
     $this->setColumn('numeric_value');
     $this->setSelect(sprintf("sum(%s)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('bounces');
     $this->setLabel('Bounces');
     $this->setEntity('base.session');
     $this->setColumn('is_bounce');
     $this->setSelect(sprintf("sum(CASE %s WHEN CONVERT(bit,'true') THEN 1 ELSE 0 END)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('shippingRevenue');
     $this->setLabel('Shipping');
     $this->setEntity('base.session');
     $this->setColumn('commerce_shipping_revenue');
     $this->setSelect(sprintf("SUM(%s)", $this->getColumn()));
     $this->setDataType('currency');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('lineItemRevenue');
     $this->setLabel('Item Revenue');
     $this->setEntity('base.commerce_line_item_fact');
     $this->setColumn('item_revenue');
     $this->setSelect(sprintf("SUM(%s)", $this->getColumn()));
     $this->setDataType('currency');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('actions');
     $this->setLabel('Actions');
     $this->setEntity('base.action_fact');
     $this->setColumn('id');
     $this->setSelect(sprintf("count(distinct %s)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('feedSubscriptions');
     $this->setLabel('Feed Subscriptions');
     $this->setEntity('base.feed_request');
     $this->setColumn('subscription_id');
     $this->setSelect(sprintf("count(distinct %s)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('uniquePageViews');
     $this->setLabel('Unique Page Views');
     $this->setEntity('base.request');
     $this->setColumn('document_id');
     $this->setSelect(sprintf("count(distinct %s)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('visitors');
     $this->setLabel('Visitors');
     $this->setEntity('base.request');
     $this->setColumn('visitor_id');
     $this->setSelect(sprintf("count(%s)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('taxRevenue');
     $this->setLabel('Tax');
     $this->setEntity('base.commerce_transaction_fact');
     $this->setColumn('tax_revenue');
     $this->setSelect(sprintf("SUM(%s)", $this->getColumn()));
     $this->setDataType('currency');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('goalCompletionsAll');
     $this->setLabel('Goal Completions');
     $this->setEntity('base.session');
     $this->setColumn('num_goals');
     $this->setSelect(sprintf("SUM(%s)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('transactions');
     $this->setLabel('Transactions');
     $this->setEntity('base.commerce_transaction_fact');
     $this->setColumn('id');
     $this->setSelect(sprintf("count(%s)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct()
 {
     $this->setName('lineItemQuantity');
     $this->setLabel('Quantity');
     $this->setEntity('base.session');
     $this->setColumn('commerce_items_quantity');
     $this->setSelect(sprintf("SUM(%s)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct($params)
 {
     $this->setMetricType($params['metric_type']);
     $this->setName($params['name']);
     $this->setLabel($params['label']);
     $this->setDataType($params['data_type']);
     if ($this->isCalculated()) {
         foreach ($params['child_metrics'] as $child) {
             $this->setChildMetric($child);
         }
         $this->setFormula($params['formula']);
     } else {
         $this->setEntity($params['entity']);
         $this->setColumn($params['column']);
     }
     return parent::__construct();
 }
 function __construct($params)
 {
     if (array_key_exists('goal_number', $params)) {
         $goal_number = $params['goal_number'];
     }
     $siteId = owa_coreAPI::getRequestParam('siteId');
     if ($siteId) {
         $gm = owa_coreAPI::getGoalManager($siteId);
         $goal = $gm->getGoal($goal_number);
         $this->setLabel("G{$goal_number} Value");
     } else {
         $this->setLabel("G{$goal_number} Value");
     }
     $name = 'goal' . $goal_number . 'Value';
     $this->setName($name);
     $this->setEntity('base.session');
     $column = 'goal_' . $goal_number . '_value';
     $this->setColumn($column);
     $this->setSelect(sprintf("SUM(%s)", $this->getColumn()));
     $this->setDataType('currency');
     return parent::__construct();
 }
 function __construct($params)
 {
     if (array_key_exists('goal_number', $params)) {
         $goal_number = $params['goal_number'];
     }
     $name = 'goal' . $goal_number . 'Completions';
     $this->setName($name);
     $siteId = owa_coreAPI::getRequestParam('siteId');
     if ($siteId) {
         $gm = owa_coreAPI::getGoalManager($siteId);
         $goal = $gm->getGoal($goal_number);
         $this->setLabel(sprintf('G%d: %s', $goal_number, $goal['goal_name']));
     } else {
         $this->setLabel(sprintf('Goal %d Completions', $goal_number));
     }
     $this->setEntity('base.session');
     $column = 'goal_' . $goal_number;
     $this->setColumn($column);
     $this->setSelect(sprintf("SUM(%s)", $this->getColumn()));
     $this->setDataType('integer');
     return parent::__construct();
 }
 function __construct($params = null)
 {
     return parent::__construct($params);
 }