function __construct()
 {
     $this->name = 'maxmind_geoip';
     $this->display_name = 'Maxmind GeoIP';
     $this->group = 'geoip';
     $this->author = 'Peter Adams';
     $this->version = '1.0';
     $this->description = 'Performs Maxmind Geo-IP lookups.';
     $this->config_required = false;
     $this->required_schema_version = 1;
     $mode = owa_coreAPI::getSetting('maxmind_geoip', 'lookup_method');
     switch ($mode) {
         case "geoip_city_isp_org_web_service":
             $method = 'getLocationFromWebService';
             break;
         case "city_lite_db":
             $method = 'getLocation';
             break;
         default:
             $method = 'getLocation';
     }
     $this->method = $method;
     // needed so default filters will not fun
     owa_coreAPI::setSetting('base', 'geolocation_service', 'maxmind');
     return parent::__construct();
 }
Example #2
0
 /**
  * Constructor
  * 
  */
 function __construct()
 {
     $this->name = 'base';
     $this->display_name = 'Open Web Analytics';
     $this->group = 'Base';
     $this->author = 'Peter Adams';
     $this->version = 9;
     $this->description = 'Base functionality for OWA.';
     $this->config_required = false;
     $this->required_schema_version = 9;
     // create event queues
     // register queue type implementations
     $this->registerImplementation('event_queue_types', 'file', 'owa_fileEventQueue', OWA_MODULES_DIR . 'base/classes/fileEventQueue.php');
     $this->registerImplementation('event_queue_types', 'database', 'owa_dbEventQueue', OWA_MODULES_DIR . 'base/classes/dbEventQueue.php');
     $this->registerImplementation('event_queue_types', 'http', 'owa_httpEventQueue', OWA_MODULES_DIR . 'base/classes/httpEventQueue.php');
     // register named queues
     $this->registerEventQueue('incoming_tracking_events', array('queue_type' => 'file', 'path' => owa_coreAPI::getSetting('base', 'async_log_dir'), 'rotation_interval' => 3600));
     // creat processing queue
     if (!owa_coreAPI::getSetting('base', 'is_remote_event_queue') && owa_coreAPI::getSetting('base', 'use_remote_event_queue') && owa_coreAPI::getSetting('base', 'remote_event_queue_endpoint')) {
         $this->registerEventQueue('incoming_tracking_events', array('queue_type' => 'http', 'endpoint' => owa_coreAPI::getSetting('base', 'remote_event_queue_endpoint')));
     } else {
         $this->registerEventQueue('processing', array('queue_type' => 'database', 'server' => owa_coreAPI::getSetting('base', 'db_host'), 'port' => owa_coreAPI::getSetting('base', 'db_port'), 'username' => owa_coreAPI::getSetting('base', 'db_user'), 'password' => owa_coreAPI::getSetting('base', 'db_password')));
     }
     return parent::__construct();
 }
 function __construct()
 {
     $this->name = 'hello';
     $this->display_name = 'Hello World';
     $this->group = 'hello';
     $this->author = 'Peter Adams';
     $this->version = '1.0';
     $this->description = 'Hello world sample module.';
     $this->config_required = false;
     $this->required_schema_version = 1;
     return parent::__construct();
 }
 function __construct()
 {
     $this->name = 'remoteQueue';
     $this->display_name = 'Remote Queue';
     $this->group = 'logging';
     $this->author = 'Peter Adams';
     $this->version = '1.0';
     $this->description = 'Posts incoming tracking events to a remote instance of OWA';
     $this->config_required = false;
     $this->required_schema_version = 1;
     // register named queues
     $endpoint = owa_coreAPI::getSetting('remoteQueue', 'endpoint');
     if ($endpoint) {
         $this->registerEventQueue('incoming_tracking_events', array('queue_type' => 'http', 'endpoint' => $endpoint));
     }
     return parent::__construct();
 }
 /**
  * Creates an instance of the ecoInsight metrics module
  **/
 function __construct()
 {
     $this->name = 'ecoinsight';
     $this->display_name = 'ecoInsight Metrics';
     $this->group = 'ecoinsight';
     $this->author = 'ecoInsight, Inc.';
     $this->version = '1.0';
     $this->description = 'Captures and process the ecoInsight service-oriented analytics and advertising-related.';
     $this->config_required = false;
     $this->required_schema_version = 1;
     owa_coreAPI::debug("Loading ecoInsight Module");
     // Time Dimensions (Needed for trend)
     $this->registerDimension('date', 'ecoinsight.eco_core', 'yyyymmdd', 'Date', 'time', 'The full date.', '', true, 'yyyymmdd');
     // Site Id (needed for Trend)
     $this->registerDimension('siteId', 'ecoinsight.eco_core', 'site_id', 'Site ID', 'site', 'The ID of the the web site.', '', true);
     // Session identifier
     $this->registerDimension('sessionId', 'ecoinsight.eco_core', 'session_id', 'Session ID', 'visit-special', 'The ID of the session/visit.', '', true);
     return parent::__construct();
 }
 /**
  * Constructor
  * 
  */
 function __construct()
 {
     $this->name = 'base';
     $this->display_name = 'Open Web Analytics';
     $this->group = 'Base';
     $this->author = 'Peter Adams';
     $this->version = 7;
     $this->description = 'Base functionality for OWA.';
     $this->config_required = false;
     $this->required_schema_version = 7;
     /**
      * Register Filters
      *
      * The following lines register filter methods. 
      */
     $this->registerFilter('operating_system', $this, 'determineOperatingSystem', 0);
     $this->registerFilter('ip_address', $this, 'setIp', 0);
     $this->registerFilter('full_host', $this, 'resolveHost', 0);
     $this->registerFilter('host', $this, 'getHostDomain', 0);
     $this->registerFilter('attributed_campaign', $this, 'attributeCampaign', 10);
     $this->registerFilter('geolocation', 'hostip', 'get_location', 10, 'classes');
     //Clean Query Strings
     if (owa_coreAPI::getSetting('base', 'clean_query_string')) {
         $this->registerFilter('page_url', $this, 'makeUrlCanonical', 0);
         $this->registerFilter('prior_page', $this, 'makeUrlCanonical', 0);
         $this->registerFilter('target_url', $this, 'makeUrlCanonical', 0);
     }
     // event procesing daemon jobs
     $this->registerBackgroundJob('process_event_queue', 'cli.php cmd=processEventQueue', owa_coreAPI::getSetting('base', 'processQueuesJobSchedule'), 10);
     /**
      * Register Metrics
      *
      * The following lines register various data metrics. 
      */
     $this->registerMetric('pageViews', array('base.pageViews', 'base.pageViewsFromSessionFact'), '', 'Page Views', 'The total number of pages viewed.', 'Site Usage');
     $this->registerMetric('uniqueVisitors', 'base.uniqueVisitors', '', 'Unique Visitors', 'The total number of unique visitors.', 'Site Usage');
     $this->registerMetric('visits', array('base.visits', 'base.visitsFromRequestFact'), '', 'Visits', 'The total number of visits/sessions.', 'Site Usage');
     $this->registerMetric('visitors', array('base.visitors', 'base.visitorsFromRequestFact'), '', 'Visitors', 'The total number of visitors', 'Site Usage');
     $this->registerMetric('newVisitors', 'base.newVisitors', '', 'New Visitors', 'The total number of new visitors', 'Site Usage');
     $this->registerMetric('repeatVisitors', 'base.repeatVisitors', '', 'Repeat Visitors', 'The total number of repeat visitors', 'Site Usage');
     $this->registerMetric('bounces', 'base.bounces', '', 'Bounces', 'The total number of visits with a single page view', 'Site Usage');
     $this->registerMetric('visitDuration', 'base.visitDuration', '', 'Visit Duration', 'The average duration of visits.', 'Site Usage');
     $this->registerMetric('uniquePageViews', 'base.uniquePageViews', '', 'Unique Page Views', 'The total number of unique pages viewed.', 'Site Usage');
     $this->registerMetric('bounceRate', 'base.bounceRate', '', 'Bounce Rate', 'The percentage of visits that were bounces.', 'Site Usage');
     $this->registerMetric('pagesPerVisit', 'base.pagesPerVisit', '', 'Pages Per Visit', 'The average pages viewed per visit.', 'Site Usage');
     $this->registerMetric('actions', 'base.actions', '', 'Actions', 'The total number of action events.', 'Actions');
     $this->registerMetric('uniqueActions', 'base.uniqueActions', '', 'Unique Actions', 'Total number of unique action events.', 'Actions');
     $this->registerMetric('actionsValue', 'base.actionsValue', '', 'Action Value', 'Total value of all action events.', 'Actions');
     $this->registerMetric('feedRequests', 'base.feedRequests', '', 'Feed Requests', 'Total number of feed requests.', 'Feeds');
     $this->registerMetric('feedReaders', 'base.feedReaders', '', 'Feed Readers', 'Total number of feed readers.', 'Feeds');
     $this->registerMetric('feedSubscriptions', 'base.feedSubscriptions', '', 'Feed Subscriptions', 'Total number of feed subscribers.', 'Feeds');
     // goals
     $gcount = owa_coreAPI::getSetting('base', 'numGoals');
     for ($num = 1; $num <= $gcount; $num++) {
         $params = array('goal_number' => $num);
         $metric_name = 'goal' . $num . 'Completions';
         $this->registerMetric($metric_name, 'base.goalNCompletions', $params, "Goal {$num} Completions", "The total number of goal {$num} completions.", 'Goals');
         $metric_name = 'goal' . $num . 'Starts';
         $this->registerMetric($metric_name, 'base.goalNStarts', $params, "Goal {$num} Starts", "The total number of goal {$num} starts.", 'Goals');
         $metric_name = 'goal' . $num . 'Value';
         $this->registerMetric($metric_name, 'base.goalNValue', $params, "Goal {$num} Value", "The total value of goal {$num} achieved.", 'Goals');
     }
     $this->registerMetric('goalCompletionsAll', 'base.goalCompletionsAll', '', 'Goal Completions', 'The total number of goal completions.', 'Goals');
     $this->registerMetric('goalStartsAll', 'base.goalStartsAll', '', 'Goal Starts', 'The total number of goal starts.', 'Goals');
     $this->registerMetric('goalValueAll', 'base.goalValueAll', '', 'Goal Value', 'The total value of all goals achieved.', 'Goals');
     $this->registerMetric('goalConversionRateAll', 'base.goalConversionRateAll', '', 'Goal Conversion Rate', 'The rate of goals achieved in all visits.', 'Goals');
     $this->registerMetric('goalAbandonRateAll', 'base.goalAbandonRateAll', '', 'Goal Abandon Rate', 'The rate of goal abandons in all visits.', 'Goals');
     // ecommerce metrics
     $this->registerMetric('lineItemQuantity', array('base.lineItemQuantity', 'base.lineItemQuantityFromSessionFact'), '', 'Item Quantity', 'The total umber of items purchased.', 'E-commerce');
     $this->registerMetric('lineItemRevenue', array('base.lineItemRevenue', 'base.lineItemRevenueFromSessionFact'), '', 'Item Revenue', 'Total revenue from items purchased.', 'E-commerce');
     $this->registerMetric('transactions', array('base.transactions', 'base.transactionsFromSessionFact'), '', 'Transactions', 'Total number of transactions.', 'E-commerce');
     $this->registerMetric('transactionRevenue', array('base.transactionRevenue', 'base.transactionRevenueFromSessionFact'), '', 'Revenue', 'Total revenue from all transactions.', 'E-commerce');
     $this->registerMetric('taxRevenue', array('base.taxRevenue', 'base.taxRevenueFromSessionFact'), '', 'Tax Revenue', 'Total revenue from taxes.', 'E-commerce');
     $this->registerMetric('shippingRevenue', array('base.shippingRevenue', 'base.shippingRevenueFromSessionFact'), '', 'Shipping Revenue', 'Total revenue from shipping.', 'E-commerce');
     $this->registerMetric('uniqueLineItems', array('base.uniqueLineItems', 'base.uniqueLineItemsFromSessionFact'), '', 'Unique Items', 'Total number of unique items purchased.', 'E-commerce');
     $this->registerMetric('revenuePerTransaction', 'base.revenuePerTransaction', '', 'Revenue Per Transaction', 'Average revenue per transaction.', 'E-commerce');
     $this->registerMetric('revenuePerVisit', 'base.revenuePerVisit', '', 'Revenue Per Visit', 'Average revenue generated per visit.', 'E-commerce');
     $this->registerMetric('ecommerceConversionRate', 'base.ecommerceConversionRate', '', 'E-commerce Conversion Rate', 'The rate of visits that resulted in an e-commerce transaction.', 'E-commerce');
     $this->registerMetric('domClicks', 'base.domClicks', '', 'Clicks', 'Total number of clicks on DOM elements.', 'Clicks');
     /**
      * Register Dimensions
      *
      * The following lines register various data dimensions.
      * To register a dimenison use the registerDimension method.
      * See owa_module class for documentation on this method.
      */
     // fact table entity names used by a number of dimensions.
     $fact_table_entities = array('base.action_fact', 'base.request', 'base.session', 'base.domstream', 'base.click', 'base.commerce_transaction_fact', 'base.commerce_line_item_fact');
     // Time Dimensions
     $this->registerDimension('date', $fact_table_entities, 'yyyymmdd', 'Date', 'time', 'The full date.', '', true, 'yyyymmdd');
     $this->registerDimension('day', $fact_table_entities, 'day', 'Day', 'time', 'The day of the month (1-31).', '', true);
     $this->registerDimension('month', $fact_table_entities, 'month', 'Month', 'time', 'The month of the year (1-12).', '', true, 'yyyymm');
     $this->registerDimension('year', $fact_table_entities, 'year', 'Year', 'time', 'The year.', '', true);
     $this->registerDimension('dayofweek', $fact_table_entities, 'dayofweek', 'Day of Week', 'time', 'The day of the week (1-7).', '', true);
     $this->registerDimension('dayofyear', $fact_table_entities, 'dayofyear', 'Day of Year', 'time', 'The day of the year (1-365).', '', true);
     $this->registerDimension('weekofyear', $fact_table_entities, 'weekofyear', 'Week of Year', 'time', 'The week of the year (1-52).', '', true);
     $this->registerDimension('date', 'base.feed_request', 'yyyymmdd', 'Date', 'time', 'The date.', '', true, 'yyyymmdd');
     $this->registerDimension('day', 'base.feed_request', 'day', 'Day', 'time', 'The day.', '', true);
     $this->registerDimension('month', 'base.feed_request', 'month', 'Month', 'time', 'The month.', '', true);
     $this->registerDimension('year', 'base.feed_request', 'year', 'Year', 'time', 'The year.', '', true);
     $this->registerDimension('dayofweek', 'base.feed_request', 'dayofweek', 'Day of Week', 'time', 'The day of the week.', '', true);
     $this->registerDimension('dayofyear', 'base.feed_request', 'dayofyear', 'Day of Year', 'time', 'The day of the year.', '', true);
     $this->registerDimension('weekofyear', 'base.feed_request', 'weekofyear', 'Week of Year', 'date', 'The week of the year.', '', true);
     // Site Dimensions
     $this->registerDimension('siteId', $fact_table_entities, 'site_id', 'Site ID', 'site', 'The ID of the the web site.', '', true);
     $this->registerDimension('siteDomain', 'base.site', 'domain', 'Site Domain', 'site', 'The domain of the web site.');
     $this->registerDimension('siteName', 'base.site', 'name', 'Site Name', 'site', 'The name of the site.');
     /*
     $this->registerDimension(
     	'siteId', 
     	'base.site', 
     	'site_id', 
     	'Site ID', 
     	'site', 
     	'The ID of the site.'
     );
     */
     $this->registerDimension('siteId', 'base.feed_request', 'site_id', 'Site ID', 'site', 'The ID of the the web site.', '', true);
     // Visitor Dimensions
     $this->registerDimension('visitorId', 'base.visitor', 'id', 'Visitor ID', 'visitor', 'The ID of the visitor.');
     $this->registerDimension('userName', $fact_table_entities, 'user_name', 'User Name', 'visitor', 'The name or ID of the user.');
     $this->registerDimension('userEmail', 'base.visitor', 'user_email', 'Email Address', 'visitor', 'The email address of the user.');
     $this->registerDimension('isRepeatVisitor', $fact_table_entities, 'is_repeat_visitor', 'Repeat Visitor', 'visitor', 'Repeat Site Visitor.', '', true);
     $this->registerDimension('isNewVisitor', $fact_table_entities, 'is_new_visitor', 'New Visitor', 'visitor', 'New Site Visitor.', '', true);
     // Visit/Session Dimensions
     $this->registerDimension('sessionId', 'base.session', 'id', 'Session ID', 'visit-special', 'The ID of the session/visit.');
     $this->registerDimension('entryPageUrl', 'base.document', 'url', 'Entry Page URL', 'visit', 'The URL of the entry page.', 'first_page_id');
     $this->registerDimension('entryPagePath', 'base.document', 'uri', 'Entry Page Path', 'visit', 'The URI of the entry page.', 'first_page_id');
     $this->registerDimension('entryPageTitle', 'base.document', 'page_title', 'Entry Page Title', 'visit', 'The title of the entry page.', 'first_page_id');
     $this->registerDimension('entryPageType', 'base.document', 'page_type', 'Entry Page Type', 'visit', 'The page type of the entry page.', 'first_page_id');
     $this->registerDimension('exitPageUrl', 'base.document', 'url', 'Exit Page URL', 'visit', 'The URL of the exit page.', 'last_page_id');
     $this->registerDimension('exitPagePath', 'base.document', 'uri', 'Exit Page Path', 'visit', 'The URI of the exit page.', 'last_page_id');
     $this->registerDimension('exitPageTitle', 'base.document', 'page_title', 'Exit Page Title', 'visit', 'The title of the exit page.', 'last_page_id');
     $this->registerDimension('exitPageType', 'base.document', 'page_type', 'Exit Page Type', 'visit', 'The page type of the exit page.', 'last_page_id');
     $this->registerDimension('timeSinceLastVisit', 'base.session', 'time_sinse_priorsession', 'Time Since Last Visit', 'visit-special', 'The time since the last visit.', '', true);
     $this->registerDimension('daysSinceLastVisit', $fact_table_entities, 'days_since_prior_session', 'Days Since Last Visit', 'visit', 'The number of days since the last visit.', '', true);
     $this->registerDimension('daysSinceFirstVisit', $fact_table_entities, 'days_since_first_session', 'Days Since First Visit', 'visit', 'The number of days since the first visit of the user.', '', true);
     $this->registerDimension('priorVisitCount', $fact_table_entities, 'num_prior_sessions', 'Prior Visits', 'visit', 'The number of prior visits, excluding the current one.', '', true);
     $this->registerDimension('pagesViewsInVisit', 'base.session', 'num_pageviews', 'Pages Viewed In Visit', 'visit', 'The number of pages viewed in a visit.', '', true);
     $this->registerDimension('revenueInVisit', 'base.session', 'commerce_trans_revenue', 'Revenue in Visit', 'visit', 'Revenue generate from e-commerce transactions in a visit.', '', true);
     $this->registerDimension('itemRevenueInVisit', 'base.session', 'commerce_item_revenue', 'Item Revenue in Visit', 'visit', 'Revenue generate from e-commerce transaction items in a visit.', '', true);
     $this->registerDimension('shippingRevenueInVisit', 'base.session', 'commerce_shipping_revenue', 'Shipping Revenue in Visit', 'visit', 'Revenue generate from e-commerce shipping in a visit.', '', true);
     $this->registerDimension('taxRevenueInVisit', 'base.session', 'commerce_tax_revenue', 'Tax Revenue in Visit', 'visit', 'Revenue generate from e-commerce tax in a visit.', '', true);
     $this->registerDimension('transactionsInVisit', 'base.session', 'commerce_trans_count', 'Transactions in Visit', 'visit', 'Number of e-commerce transactions completed in a visit.', '', true);
     $this->registerDimension('itemQuantityInVisit', 'base.session', 'commerce_items_quantity', 'Item Quantity in Visit', 'visit', 'Number of e-commerce items purchased completed in a visit.', '', true);
     $this->registerDimension('distinctItemsInVisit', 'base.session', 'commerce_items_count', 'Distinct Items in Visit', 'visit', 'Number of distinct items purchased in Visit.', '', true);
     $this->registerDimension('goalsInVisit', 'base.session', 'num_goals', 'Goals in Visit', 'visit', 'Goals completed in a visit.', '', true);
     $this->registerDimension('goalStartsInVisit', 'base.session', 'num_goal_starts', 'Goal Starts in Visit', 'visit', 'Goals started in a visit.', '', true);
     $this->registerDimension('goalValueInVisit', 'base.session', 'goals_value', 'Goal Value in Visit', 'visit', 'Total value from all goals in a visit.', '', true);
     // System/Technology Dimensions
     $this->registerDimension('browserVersion', 'base.ua', 'browser', 'Browser Version', 'system', 'The browser version of the visitor.');
     $this->registerDimension('browserType', 'base.ua', 'browser_type', 'Browser Type', 'system', 'The browser type of the visitor.');
     $this->registerDimension('osType', 'base.os', 'name', 'Operating System', 'system', 'The operating System of the visitor.');
     $this->registerDimension('language', $fact_table_entities, 'language', 'Language', 'system', 'The language of the visit.', '', true);
     // Geo Dimensions
     $this->registerDimension('city', 'base.location_dim', 'city', 'City', 'geo', 'The city of the visitor.');
     $this->registerDimension('country', 'base.location_dim', 'country', 'Country', 'geo', 'The country of the visitor.');
     $this->registerDimension('latitude', 'base.location_dim', 'latitude', 'Latitude', 'geo', 'The latitude of the visitor.');
     $this->registerDimension('longitude', 'base.location_dim', 'longitude', 'Longitude', 'geo', 'The longitude of the visitor.');
     $this->registerDimension('countryCode', 'base.location_dim', 'country_code', 'Country Code', 'geo', 'The ISO country code of the visitor.');
     $this->registerDimension('stateRegion', 'base.location_dim', 'state', 'State/Region', 'geo', 'The state or region of the visitor.');
     // Network Dimensions
     $this->registerDimension('ipAddress', 'base.host', 'ip_address', 'IP Address', 'network', 'The IP address of the visitor.');
     $this->registerDimension('hostName', 'base.host', 'host', 'Host Name', 'network', 'The host name of the network used by the visitor.');
     // Campaign Dimensions
     $this->registerDimension('medium', $fact_table_entities, 'medium', 'Medium', 'campaign', 'The medium where visit originated from.', '', true);
     $this->registerDimension('source', 'base.source_dim', 'source_domain', 'Source', 'campaign', 'The traffic source of the visit.');
     $this->registerDimension('campaign', 'base.campaign_dim', 'name', 'Campaign', 'campaign', 'The campaign that originated the visit.');
     $this->registerDimension('ad', 'base.ad_dim', 'name', 'Ad', 'campaign', 'The name of the ad that originated the visit.');
     $this->registerDimension('adType', 'base.ad_dim', 'type', 'Ad Type', 'campaign', 'The type of ad that originated the visit.');
     $this->registerDimension('referralPageUrl', 'base.referer', 'url', 'Referral Page URL', 'campaign', 'The url of the referring web page.');
     $this->registerDimension('referralPageTitle', 'base.referer', 'page_title', 'Referral Page Title', 'campaign', 'The title of the referring web page.');
     $this->registerDimension('referralSearchTerms', 'base.search_term_dim', 'terms', 'Search Terms', 'campaign', 'The referring search terms.', 'referring_search_term_id');
     $this->registerDimension('referralLinkText', 'base.referer', 'refering_anchortext', 'Referral Link Text', 'campaign', 'The text of the referring link.');
     $this->registerDimension('isSearchEngine', 'base.referer', 'is_searchengine', 'Search Engine', 'campaign', 'Is traffic source a search engine.');
     $this->registerDimension('referralWebSite', 'base.referer', 'site', 'Referral Web Site', 'campaign', 'The full domain of the referring web site.');
     $this->registerDimension('latestAttributions', 'base.session', 'latest_attributions', 'Latest Attributions', 'campaign-special', 'The latest campaign attributions.', '', true);
     // Page Content
     $this->registerDimension('priorPageUrl', 'base.document', 'url', 'Prior Page URL', 'content', 'The URL of the prior page.', 'prior_document_id');
     $this->registerDimension('priorPagePath', 'base.document', 'uri', 'Prior Page Path', 'content', 'The URI of the prior page.', 'prior_document_id');
     $this->registerDimension('priorPageTitle', 'base.document', 'page_title', 'Prior Page Title', 'content', 'The title of the prior page.', 'prior_document_id');
     $this->registerDimension('priorPageType', 'base.document', 'page_type', 'Prior Page Type', 'content', 'The page type of the prior page.', 'prior_document_id');
     $this->registerDimension('pageUrl', 'base.document', 'url', 'Page URL', 'content', 'The URL of the web page.', 'document_id');
     $this->registerDimension('pagePath', 'base.document', 'uri', 'Page Path', 'content', 'The path of the web page.', 'document_id');
     $this->registerDimension('pageTitle', 'base.document', 'page_title', 'Page Title', 'content', 'The title of the web page.', 'document_id');
     $this->registerDimension('pageType', 'base.document', 'page_type', 'Page Type', 'content', 'The page type of the web page.', 'document_id');
     // Action Event Dimensions
     $this->registerDimension('actionName', 'base.action_fact', 'action_name', 'Action Name', 'actions', 'The name of the action.', '', true);
     $this->registerDimension('actionGroup', 'base.action_fact', 'action_group', 'Action Group', 'actions', 'The group that an action belongs to.', '', true);
     $this->registerDimension('actionLabel', 'base.action_fact', 'action_label', 'Action Label', 'actions', 'The label associated with an action.', '', true);
     // Ecommerce Dimensions
     $this->registerDimension('productName', 'base.commerce_line_item_fact', 'product_name', 'Product Name', 'ecommerce', 'The name of the product purchased.', '', true);
     $this->registerDimension('productSku', 'base.commerce_line_item_fact', 'sku', 'Product SKU', 'ecommerce', 'The SKU code of the product purchased.', '', true);
     $this->registerDimension('productCategory', 'base.commerce_line_item_fact', 'category', 'Product Category', 'ecommerce', 'The category of product purchased.', '', true);
     $this->registerDimension('transactionOriginator', 'base.commerce_transaction_fact', 'order_source', 'Originator', 'ecommerce', 'The store or location that originated the transaction.', '', true);
     $this->registerDimension('transactionId', 'base.commerce_transaction_fact', 'order_id', 'Transaction ID', 'ecommerce', 'The id of the e-commerce transaction.', '', true);
     $this->registerDimension('transactionGateway', 'base.commerce_transaction_fact', 'gateway', 'Payment Gateway', 'ecommerce', 'The payment gateway/provider used to clear the transaction.', '', true);
     $this->registerDimension('daysToTransaction', 'base.commerce_transaction_fact', 'days_since_first_session', 'Days To Purchase', 'ecommerce', 'The number of days since the first visit and an e-commerce transaction.', '', true);
     $this->registerDimension('daysToTransaction', 'base.commerce_transaction_fact', 'days_since_first_session', 'Days To Purchase', 'ecommerce', 'The number of days since the first visit and an e-commerce transaction.', '', true);
     $this->registerDimension('visitsToTransaction', 'base.commerce_transaction_fact', 'num_prior_sessions', 'Visits To Purchase', 'ecommerce', 'The number of visits before the transaction occurred.', '', true);
     $this->registerDimension('visitsToTransaction', 'base.commerce_transaction_fact', 'num_prior_sessions', 'Visits To Purchase', 'ecommerce', 'The number of visits prior to an e-commerce transaction.', '', true);
     $this->registerDimension('timestamp', 'base.commerce_transaction_fact', 'timestamp', 'Time', 'ecommerce-special', 'The timestamp of the transaction.', '', true);
     // Click Dimensions
     $this->registerDimension('domElementId', 'base.click', 'dom_element_id', 'Dom ID', 'dom', 'The id of the dom element.', '', true);
     $this->registerDimension('domElementName', 'base.click', 'dom_element_name', 'Dom Name', 'dom', 'The name of the dom element.', '', true);
     $this->registerDimension('domElementText', 'base.click', 'dom_element_text', 'Dom Text', 'dom', 'The text associated the dom element.', '', true);
     $this->registerDimension('domElementValue', 'base.click', 'dom_element_value', 'Dom Value', 'dom', 'The value of the dom element.', '', true);
     $this->registerDimension('domElementTag', 'base.click', 'dom_element_tag', 'Dom Tag', 'dom', 'The html tag of the dom element.', '', true);
     $this->registerDimension('domElementClass', 'base.click', 'dom_element_class', 'Dom Class', 'dom', 'The class of the dom element.', '', true);
     // Feed Dimensions
     $this->registerDimension('feedType', 'base.feed_request', 'feed_format', 'Feed Type', 'feed', 'The type or format of the feed.', '', true);
     // Custom variable Dimensions
     $cv_max = owa_coreAPI::getSetting('base', 'maxCustomVars');
     for ($i = 1; $i <= $cv_max; $i++) {
         $cvar_name_col = 'cv' . $i . '_name';
         $cvar_name_label = "Custom Var {$i} Name";
         $cvar_name_description = "The name of custom variable {$i}.";
         $this->registerDimension('customVarName' . $i, array('base.action_fact', 'base.request', 'base.session', 'base.domstream', 'base.click', 'base.commerce_transaction_fact', 'base.commerce_line_item_fact'), $cvar_name_col, $cvar_name_label, 'custom variables', $cvar_name_description, '', true, 'string');
         $cvar_value_col = 'cv' . $i . '_value';
         $cvar_value_label = "Custom Var {$i} Value";
         $cvar_value_description = "The value of custom variable {$i}.";
         $this->registerDimension('customVarValue' . $i, array('base.action_fact', 'base.request', 'base.session', 'base.domstream', 'base.click', 'base.commerce_transaction_fact', 'base.commerce_line_item_fact'), $cvar_value_col, $cvar_value_label, 'custom variables', $cvar_value_description, '', true, 'string');
     }
     /**
      * Register CLI Commands
      *
      * The following lines register various command line interface (CLI) controller. 
      */
     $this->registerCliCommand('update', 'base.updatesApplyCli');
     $this->registerCliCommand('build', 'base.build');
     $this->registerCliCommand('flush-cache', 'base.flushCacheCli');
     $this->registerCliCommand('processEventQueue', 'base.processEventQueue');
     $this->registerCliCommand('install', 'base.installCli');
     $this->registerCliCommand('activate', 'base.moduleActivateCli');
     $this->registerCliCommand('deactivate', 'base.moduleDeactivateCli');
     $this->registerCliCommand('install-module', 'base.moduleInstallCli');
     $this->registerCliCommand('add-site', 'base.sitesAddCli');
     $this->registerCliCommand('flush-processed-events', 'base.flushProcessedEventsCli');
     /**
      * Register API methods
      *
      * The following lines register various API methods. 
      */
     $this->registerApiMethod('getResultSet', array($this, 'getResultSet'), array('metrics', 'dimensions', 'siteId', 'constraints', 'sort', 'resultsPerPage', 'page', 'offset', 'period', 'startDate', 'endDate', 'startTime', 'endTime', 'format', 'segment'), '', 'view_reports');
     $this->registerApiMethod('getDomstreams', array($this, 'getDomstreams'), array('startDate', 'endDate', 'document_id', 'siteId', 'resultsPerPage', 'page', 'format'), '', 'view_reports');
     $this->registerApiMethod('getLatestVisits', array($this, 'getLatestVisits'), array('startDate', 'endDate', 'visitorId', 'siteId', 'resultsPerPage', 'page', 'format'), '', 'view_reports');
     $this->registerApiMethod('getClickstream', array($this, 'getClickstream'), array('sessionId', 'resultsPerPage', 'page', 'format'), '', 'view_reports');
     $this->registerApiMethod('getVisitDetail', array($this, 'getVisitDetail'), array('sessionId', 'format'), '', 'view_reports');
     $this->registerApiMethod('getTransactionDetail', array($this, 'getTransactionDetail'), array('transactionId', 'format'), '', 'view_reports');
     $this->registerApiMethod('getDomClicks', array($this, 'getDomClicks'), array('pageUrl', 'siteId', 'startDate', 'endDate', 'document_id', 'period', 'resultsPerPage', 'page', 'format'), '', 'view_reports');
     $this->registerApiMethod('getTransactions', array($this, 'getTransactions'), array('siteId', 'startDate', 'endDate', 'period', 'sort', 'resultsPerPage', 'page', 'format'), '', 'view_reports');
     $this->registerApiMethod('getDomstream', array($this, 'getDomstream'), array('domstream_guid'), '', 'view_reports');
     return parent::__construct();
 }