diff --git a/core/DataTable/Renderer/Csv.php b/core/DataTable/Renderer/Csv.php
index 4eee1949b7a96b9dd5ef289ec8c9aa13eef442f6..c3fb08b15ae99b716de4045849a79b6179dbd626 100644
--- a/core/DataTable/Renderer/Csv.php
+++ b/core/DataTable/Renderer/Csv.php
@@ -70,6 +70,8 @@ class Csv extends Renderer
      */
     const NO_DATA_AVAILABLE = 'No data available';
 
+    private $unsupportedColumns = array();
+
     /**
      * Computes the dataTable output and returns the string/binary
      *
@@ -213,6 +215,12 @@ class Csv extends Renderer
      */
     private function getHeaderLine($columnMetrics)
     {
+        foreach ($columnMetrics as $index => $value) {
+            if (in_array($value, $this->unsupportedColumns)) {
+                unset($columnMetrics[$index]);
+            }
+        }
+
         if ($this->translateColumnNames) {
             $columnMetrics = $this->translateColumnNames($columnMetrics);
         }
@@ -391,12 +399,23 @@ class Csv extends Renderer
                         $name = 'metadata_' . $name;
                     }
 
-                    $csvRow[$name] = $value;
+                    if (is_array($value)) {
+                        if (!in_array($name, $this->unsupportedColumns)) {
+                            $this->unsupportedColumns[] = $name;
+                        }
+                    } else {
+                        $csvRow[$name] = $value;
+                    }
+
                 }
             }
 
             foreach ($csvRow as $name => $value) {
-                $allColumns[$name] = true;
+                if (in_array($name, $this->unsupportedColumns)) {
+                    unset($allColumns[$name]);
+                } else {
+                    $allColumns[$name] = true;
+                }
             }
 
             if ($this->exportIdSubtable) {
@@ -410,6 +429,15 @@ class Csv extends Renderer
 
             $csv[] = $csvRow;
         }
+
+        if (!empty($this->unsupportedColumns)) {
+            foreach ($this->unsupportedColumns as $unsupportedColumn) {
+                foreach ($csv as $index => $row) {
+                    unset($row[$index][$unsupportedColumn]);
+                }
+            }
+        }
+
         return $csv;
     }
 
diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php
index f2d788cd545787151b579eb77b4807896b6b5798..7cf82cfd3bcd5da8e21085ecffae20e2a6390066 100644
--- a/plugins/CoreHome/CoreHome.php
+++ b/plugins/CoreHome/CoreHome.php
@@ -134,6 +134,7 @@ class CoreHome extends \Piwik\Plugin
         $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/trim.js";
         $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/pretty-url.js";
         $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/htmldecode.js";
+        $jsFiles[] = "plugins/CoreHome/angularjs/common/filters/ucfirst.js";
 
         $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/directive.module.js";
         $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/autocomplete-matched.js";
diff --git a/plugins/CoreHome/angularjs/common/filters/ucfirst.js b/plugins/CoreHome/angularjs/common/filters/ucfirst.js
new file mode 100644
index 0000000000000000000000000000000000000000..34b3460be89f52064ce5efa022be112f9ac8dce0
--- /dev/null
+++ b/plugins/CoreHome/angularjs/common/filters/ucfirst.js
@@ -0,0 +1,21 @@
+/*!
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+(function () {
+    angular.module('piwikApp.filter').filter('ucfirst', ucfirst);
+
+    function ucfirst() {
+
+        return function(value) {
+            if (!value) {
+                return value;
+            }
+
+            var firstLetter = (value + '').charAt(0).toUpperCase();
+            return firstLetter + value.substr(1);
+        };
+    }
+})();
diff --git a/plugins/CustomVariables/API.php b/plugins/CustomVariables/API.php
index fa3a99dbca344ff8501d26ee8f185f245d8bd760..57832927e59e435f0f2c824b3e7e48ad8a1c3d74 100644
--- a/plugins/CustomVariables/API.php
+++ b/plugins/CustomVariables/API.php
@@ -8,10 +8,12 @@
  */
 namespace Piwik\Plugins\CustomVariables;
 
+use Piwik\API\Request;
 use Piwik\Archive;
 use Piwik\DataTable;
 use Piwik\Date;
 use Piwik\Metrics;
+use Piwik\Piwik;
 use Piwik\Plugins\Actions\Actions\ActionSiteSearch;
 
 /**
@@ -71,6 +73,7 @@ class API extends \Piwik\Plugin\API
             }
         }
 
+
         if ($flat) {
             $dataTable->filterSubtables('Piwik\Plugins\CustomVariables\DataTable\Filter\CustomVariablesValuesFromNameId');
         } else {
@@ -109,9 +112,62 @@ class API extends \Piwik\Plugin\API
             // Hack Ecommerce product price tracking to display correctly
             $dataTable->renameColumn('price_viewed', 'price');
         }
+
         $dataTable->filter('Piwik\Plugins\CustomVariables\DataTable\Filter\CustomVariablesValuesFromNameId');
 
         return $dataTable;
     }
+
+    /**
+     * Get a list of all available custom variable slots (scope + index) and which names have been used so far in
+     * each slot since the beginning of the website.
+     *
+     * @param int $idSite
+     * @return array
+     */
+    public function getUsagesOfSlots($idSite)
+    {
+        Piwik::checkUserHasAdminAccess($idSite);
+
+        $numVars = CustomVariables::getNumUsableCustomVariables();
+
+        $usedCustomVariables = array(
+            'visit' => array_fill(1, $numVars, array()),
+            'page'  => array_fill(1, $numVars, array()),
+        );
+
+        /** @var DataTable $customVarUsages */
+        $customVarUsages = Request::processRequest('CustomVariables.getCustomVariables',
+            array('idSite' => $idSite, 'period' => 'range', 'date' => '2008-12-12,today',
+                  'format' => 'original', 'serialize' => '0')
+        );
+
+        foreach ($customVarUsages->getRows() as $row) {
+            $slots = $row->getMetadata('slots');
+
+            if (!empty($slots)) {
+                foreach ($slots as $slot) {
+                    $usedCustomVariables[$slot['scope']][$slot['index']][] = array(
+                        'name' => $row->getColumn('label'),
+                        'nb_visits' => $row->getColumn('nb_visits'),
+                        'nb_actions' => $row->getColumn('nb_actions'),
+                    );
+                }
+            }
+        }
+
+        $grouped = array();
+        foreach ($usedCustomVariables as $scope => $scopes) {
+            foreach ($scopes as $index => $cvars) {
+                $grouped[] = array(
+                    'scope' => $scope,
+                    'index' => $index,
+                    'usages' => $cvars
+                );
+            }
+        }
+
+        return $grouped;
+    }
 }
 
diff --git a/plugins/CustomVariables/Archiver.php b/plugins/CustomVariables/Archiver.php
index bc43cbc8ddfdf245ccc588d8f291cd0a9bb38474..4a53ab78df307d527e23b98061385a44224cf1d6 100644
--- a/plugins/CustomVariables/Archiver.php
+++ b/plugins/CustomVariables/Archiver.php
@@ -8,7 +8,6 @@
  */
 namespace Piwik\Plugins\CustomVariables;
 
-use Piwik\Common;
 use Piwik\Config;
 use Piwik\DataAccess\LogAggregator;
 use Piwik\DataArray;
@@ -35,6 +34,9 @@ class Archiver extends \Piwik\Plugin\Archiver
     protected $maximumRowsInSubDataTable;
     protected $newEmptyRow;
 
+    private $metadata = array();
+    private $metadataFlat = array();
+
     function __construct($processor)
     {
         parent::__construct($processor);
@@ -74,6 +76,16 @@ class Archiver extends \Piwik\Plugin\Archiver
         $this->removeVisitsMetricsFromActionsAggregate();
         $this->dataArray->enrichMetricsWithConversions();
         $table = $this->dataArray->asDataTable();
+
+        foreach ($table->getRows() as $row) {
+            $label = $row->getColumn('label');
+            if (!empty($this->metadata[$label])) {
+                foreach ($this->metadata[$label] as $name => $value) {
+                    $row->addMetadata($name, $value);
+                }
+            }
+        }
+
         $blob = $table->getSerialized(
             $this->maximumRowsInDataTableLevelZero, $this->maximumRowsInSubDataTable,
             $columnToSort = Metrics::INDEX_NB_VISITS
@@ -118,6 +130,8 @@ class Archiver extends \Piwik\Plugin\Archiver
             $key = $row[$keyField];
             $value = $this->cleanCustomVarValue($row[$valueField]);
 
+            $this->addMetadata($keyField, $key, Model::SCOPE_VISIT);
+
             $this->dataArray->sumMetricsVisits($key, $row);
             $this->dataArray->sumMetricsVisitsPivot($key, $value, $row);
         }
@@ -137,6 +151,8 @@ class Archiver extends \Piwik\Plugin\Archiver
             $key = $row[$keyField];
             $value = $this->cleanCustomVarValue($row[$valueField]);
 
+            $this->addMetadata($keyField, $key, Model::SCOPE_PAGE);
+
             $alreadyAggregated = $this->aggregateEcommerceCategories($key, $value, $row);
             if (!$alreadyAggregated) {
                 $this->aggregateActionByKeyAndValue($key, $value, $row);
@@ -145,6 +161,22 @@ class Archiver extends \Piwik\Plugin\Archiver
         }
     }
 
+    private function addMetadata($keyField, $label, $scope)
+    {
+        $index = (int) str_replace('custom_var_k', '', $keyField);
+
+        if (!array_key_exists($label, $this->metadata)) {
+            $this->metadata[$label] = array('slots' => array());
+        }
+
+        $uniqueId = $label . 'scope' . $scope . 'index' . $index;
+
+        if (!isset($this->metadataFlat[$uniqueId])) {
+            $this->metadata[$label]['slots'][] = array('scope' => $scope, 'index' => $index);
+            $this->metadataFlat[$uniqueId] = true;
+        }
+    }
+
     /**
      * @param string $key
      * @param string $value
@@ -205,6 +237,7 @@ class Archiver extends \Piwik\Plugin\Archiver
         }
         while ($row = $query->fetch()) {
             $key = $row[$keyField];
+
             $value = $this->cleanCustomVarValue($row[$valueField]);
             $this->dataArray->sumMetricsGoals($key, $row);
             $this->dataArray->sumMetricsGoalsPivot($key, $value, $row);
diff --git a/plugins/CustomVariables/Controller.php b/plugins/CustomVariables/Controller.php
index 59a4a949de473ded0bec8055307aee477a201d4c..e73e58b257a7f43c521798c5a465e15f5fba5615 100644
--- a/plugins/CustomVariables/Controller.php
+++ b/plugins/CustomVariables/Controller.php
@@ -8,7 +8,20 @@
  */
 namespace Piwik\Plugins\CustomVariables;
 
+use Piwik\Common;
+use Piwik\DataTable;
+use Piwik\Piwik;
+
 class Controller extends \Piwik\Plugin\Controller
 {
+    public function manage()
+    {
+        $idSite = Common::getRequestVar('idSite');
+
+        Piwik::checkUserHasAdminAccess($idSite);
+
+        return $this->renderTemplate('manage', array());
+    }
+
 }
 
diff --git a/plugins/CustomVariables/CustomVariables.php b/plugins/CustomVariables/CustomVariables.php
index b8a57ad6a65fd3152d2ab9d76b8295f6fbad8e57..03238212f160ddfb78e76ddcefb5d8de8a1d2e8f 100644
--- a/plugins/CustomVariables/CustomVariables.php
+++ b/plugins/CustomVariables/CustomVariables.php
@@ -22,7 +22,10 @@ class CustomVariables extends \Piwik\Plugin
     {
         return array(
             'API.getSegmentDimensionMetadata' => 'getSegmentsMetadata',
-            'Live.getAllVisitorDetails'       => 'extendVisitorDetails'
+            'Live.getAllVisitorDetails'       => 'extendVisitorDetails',
+            'AssetManager.getJavaScriptFiles' => 'getJsFiles',
+            'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys',
+            'AssetManager.getStylesheetFiles'        => 'getStylesheetFiles',
         );
     }
 
@@ -144,4 +147,32 @@ class CustomVariables extends \Piwik\Plugin
         }
     }
 
+    public function getClientSideTranslationKeys(&$translationKeys)
+    {
+        $translationKeys[] = 'CustomVariables_CustomVariables';
+        $translationKeys[] = 'CustomVariables_ManageDescription';
+        $translationKeys[] = 'CustomVariables_Scope';
+        $translationKeys[] = 'CustomVariables_Index';
+        $translationKeys[] = 'CustomVariables_Usages';
+        $translationKeys[] = 'CustomVariables_Unused';
+        $translationKeys[] = 'CustomVariables_CreateNewSlot';
+        $translationKeys[] = 'CustomVariables_UsageDetails';
+        $translationKeys[] = 'CustomVariables_CurrentAvailableCustomVariables';
+        $translationKeys[] = 'CustomVariables_ToCreateCustomVarExecute';
+        $translationKeys[] = 'CustomVariables_CreatingCustomVariableTakesTime';
+        $translationKeys[] = 'General_Loading';
+    }
+
+    public function getStylesheetFiles(&$stylesheets)
+    {
+        $stylesheets[] = "plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.directive.less";
+    }
+
+    public function getJsFiles(&$jsFiles)
+    {
+        $jsFiles[] = "plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.model.js";
+        $jsFiles[] = "plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.controller.js";
+        $jsFiles[] = "plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.directive.js";
+    }
+
 }
diff --git a/plugins/CustomVariables/Menu.php b/plugins/CustomVariables/Menu.php
new file mode 100644
index 0000000000000000000000000000000000000000..80e1d78193d471ca114c2682c02e3296d46f8198
--- /dev/null
+++ b/plugins/CustomVariables/Menu.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\CustomVariables;
+
+use Piwik\Common;
+use Piwik\Menu\MenuUser;
+use Piwik\Piwik;
+use Piwik\Plugins\UsersManager\UserPreferences;
+
+/**
+ * This class allows you to add, remove or rename menu items.
+ * To configure a menu (such as Admin Menu, Reporting Menu, User Menu...) simply call the corresponding methods as
+ * described in the API-Reference http://developer.piwik.org/api-reference/Piwik/Menu/MenuAbstract
+ */
+class Menu extends \Piwik\Plugin\Menu
+{
+    public function configureUserMenu(MenuUser $menu)
+    {
+        $userPreferences = new UserPreferences();
+        $default = $userPreferences->getDefaultWebsiteId();
+        $idSite = Common::getRequestVar('idSite', $default, 'int');
+
+        if (Piwik::isUserHasAdminAccess($idSite)) {
+            $menu->addManageItem('Custom Variables', $this->urlForAction('manage'), $orderId = 30);
+        }
+    }
+}
diff --git a/plugins/CustomVariables/Model.php b/plugins/CustomVariables/Model.php
index 9d98a352fa2683069bcf49378aecc56769d986db..235809e1da3bf0999b3af1f0daaa2334075898cd 100644
--- a/plugins/CustomVariables/Model.php
+++ b/plugins/CustomVariables/Model.php
@@ -15,12 +15,14 @@ use Piwik\Log;
 
 class Model
 {
-    const SCOPE_PAGE = 'log_link_visit_action';
-    const SCOPE_VISIT = 'log_visit';
-    const SCOPE_CONVERSION = 'log_conversion';
     const DEFAULT_CUSTOM_VAR_COUNT = 5;
 
+    const SCOPE_PAGE = 'page';
+    const SCOPE_VISIT = 'visit';
+    const SCOPE_CONVERSION = 'conversion';
+
     private $scope = null;
+    private $table = null;
 
     public function __construct($scope)
     {
@@ -29,21 +31,27 @@ class Model
         }
 
         $this->scope = $scope;
+        $this->table = Common::prefixTable($this->getTableNameFromScope($scope));
     }
 
-    public function getScopeName()
+    private function getTableNameFromScope($scope)
     {
         // actually we should have a class for each scope but don't want to overengineer it for now
-        switch ($this->scope) {
+        switch ($scope) {
             case self::SCOPE_PAGE:
-                return 'Page';
+                return 'log_link_visit_action';
             case self::SCOPE_VISIT:
-                return 'Visit';
+                return 'log_visit';
             case self::SCOPE_CONVERSION:
-                return 'Conversion';
+                return 'log_conversion';
         }
     }
 
+    public function getScopeName()
+    {
+        return ucfirst($this->scope);
+    }
+
     /**
      * @see getHighestCustomVarIndex()
      * @return int
@@ -96,8 +104,7 @@ class Model
 
     private function getCustomVarColumnNames()
     {
-        $dbTable = $this->getDbTableName();
-        $columns = Db::getColumnNamesFromTable($dbTable);
+        $columns = Db::getColumnNamesFromTable($this->table);
 
         $customVarColumns = array_filter($columns, function ($column) {
             return false !== strpos($column, 'custom_var_');
@@ -108,14 +115,13 @@ class Model
 
     public function removeCustomVariable()
     {
-        $dbTable = $this->getDbTableName();
-        $index   = $this->getHighestCustomVarIndex();
+        $index = $this->getHighestCustomVarIndex();
 
         if ($index < 1) {
             return null;
         }
 
-        Db::exec(sprintf('ALTER TABLE %s ', $dbTable)
+        Db::exec(sprintf('ALTER TABLE %s ', $this->table)
                . sprintf('DROP COLUMN custom_var_k%d,', $index)
                . sprintf('DROP COLUMN custom_var_v%d;', $index));
 
@@ -124,22 +130,16 @@ class Model
 
     public function addCustomVariable()
     {
-        $dbTable = $this->getDbTableName();
-        $index   = $this->getHighestCustomVarIndex() + 1;
-        $maxLen  = CustomVariables::getMaxLengthCustomVariables();
+        $index  = $this->getHighestCustomVarIndex() + 1;
+        $maxLen = CustomVariables::getMaxLengthCustomVariables();
 
-        Db::exec(sprintf('ALTER TABLE %s ', $dbTable)
+        Db::exec(sprintf('ALTER TABLE %s ', $this->table)
                . sprintf('ADD COLUMN custom_var_k%d VARCHAR(%d) DEFAULT NULL,', $index, $maxLen)
                . sprintf('ADD COLUMN custom_var_v%d VARCHAR(%d) DEFAULT NULL;', $index, $maxLen));
 
         return $index;
     }
 
-    private function getDbTableName()
-    {
-        return Common::prefixTable($this->scope);
-    }
-
     public static function getCustomVariableIndexFromFieldName($fieldName)
     {
         $onlyNumber = str_replace(array('custom_var_k', 'custom_var_v'), '', $fieldName);
diff --git a/plugins/CustomVariables/Tracker/CustomVariablesRequestProcessor.php b/plugins/CustomVariables/Tracker/CustomVariablesRequestProcessor.php
index 44e6d593504ba183293a9e167fe61351b828fc96..720aca8431b55cdfa84ce7e9e4b37e2d88324a7b 100644
--- a/plugins/CustomVariables/Tracker/CustomVariablesRequestProcessor.php
+++ b/plugins/CustomVariables/Tracker/CustomVariablesRequestProcessor.php
@@ -9,6 +9,8 @@
 namespace Piwik\Plugins\CustomVariables\Tracker;
 
 use Piwik\Common;
+use Piwik\Plugins\CustomVariables\CustomVariables;
+use Piwik\Plugins\CustomVariables\Model;
 use Piwik\Tracker\Request;
 use Piwik\Tracker\RequestProcessor;
 use Piwik\Tracker\Visit\VisitProperties;
@@ -36,7 +38,7 @@ class CustomVariablesRequestProcessor extends RequestProcessor
     public function processRequestParams(VisitProperties $visitProperties, Request $request)
     {
         // TODO: re-add optimization where if custom variables exist in request, don't bother selecting them in Visitor
-        $visitorCustomVariables = $request->getCustomVariables($scope = 'visit');
+        $visitorCustomVariables = $request->getCustomVariables($scope = Model::SCOPE_VISIT);
         if (!empty($visitorCustomVariables)) {
             Common::printDebug("Visit level Custom Variables: ");
             Common::printDebug($visitorCustomVariables);
diff --git a/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.controller.js b/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.controller.js
new file mode 100644
index 0000000000000000000000000000000000000000..4b6b1c213dc4ef736dc3a992da26e5977a27d193
--- /dev/null
+++ b/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.controller.js
@@ -0,0 +1,35 @@
+/*!
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+(function () {
+    angular.module('piwikApp').controller('ManageCustomVarsController', ManageCustomVarsController);
+
+    ManageCustomVarsController.$inject = ['manageCustomVarsModel', 'piwik', '$filter'];
+
+    function ManageCustomVarsController(manageCustomVarsModel, piwik, $filter) {
+        manageCustomVarsModel.fetchUsages();
+
+        this.model = manageCustomVarsModel;
+        this.createCustomVariableSlot = function () {
+            var highestIndex = 5;
+            angular.forEach(manageCustomVarsModel.customVariables, function (customVar) {
+                if (customVar.index > highestIndex) {
+                    highestIndex = customVar.index;
+                }
+            });
+
+            var translate = $filter('translate');
+
+            var command = './console customvariables:set-max-custom-variables ' + (highestIndex + 1);
+            var text = translate('CustomVariables_CreatingCustomVariableTakesTime');
+            text += '<br /><br />' + translate('CustomVariables_CurrentAvailableCustomVariables', '<strong>' + highestIndex + '</strong>');
+            text += '<br /><br />' + translate('CustomVariables_ToCreateCustomVarExecute');
+            text += '<br /><br /><code>' + command + '</code>';
+
+            piwik.helper.modalConfirm('<div class="ui-confirm" title="' + translate('CustomVariables_CreateNewSlot') + '">' + text + '<br /><br /></div>');
+        }
+    }
+})();
\ No newline at end of file
diff --git a/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.directive.html b/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.directive.html
new file mode 100644
index 0000000000000000000000000000000000000000..8cc7c60e600648391e079f8ebf75658b0bfc6238
--- /dev/null
+++ b/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.directive.html
@@ -0,0 +1,41 @@
+<div class="manageCustomVars">
+    <h2 piwik-enriched-headline>{{ 'CustomVariables_CustomVariables'|translate }}</h2>
+
+    {{ 'CustomVariables_ManageDescription'|translate }}
+
+    <br />
+
+    <h3>{{ customVariables.scope }}</h3>
+    <table class="dataTable entityTable" style="max-width: 900px;">
+        <thead>
+        <tr>
+            <th>{{'CustomVariables_Scope'|translate }}</th>
+            <th>{{'CustomVariables_Index'|translate }}</th>
+            <th>{{'CustomVariables_Usages'|translate }}</th>
+        </tr>
+        </thead>
+        <tbody>
+        <tr>
+            <td colspan="3" ng-show="manageCustomVars.model.isLoading">{{ 'General_Loading'|translate }}</td>
+        </tr>
+        <tr ng-repeat="customVariables in manageCustomVars.model.customVariables">
+            <td class="scope">{{ customVariables.scope|ucfirst }}</td>
+            <td class="index">{{ customVariables.index }}</td>
+            <td>
+                <span ng-show="(customVariables.usages|length) === 0"
+                      class="unused">{{'CustomVariables_Unused'|translate }}</span>
+                <span ng-show="customVariables.usages|length" ng-repeat="cvar in customVariables.usages|orderBy:'-nb_actions'">
+                    <span title="{{ 'CustomVariables_UsageDetails'|translate:cvar.nb_visits:cvar.nb_actions }}">{{ cvar.name }}</span><span ng-show="!$last">, </span>
+                </span>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+
+    <br/>
+    <a class="btn addCustomVar" ng-show="!manageCustomVars.model.isLoading" value=""
+       ng-click="manageCustomVars.createCustomVariableSlot()"
+            >{{ 'CustomVariables_CreateNewSlot'|translate }} <span class="icon-info"></span></a><br/>
+
+
+</div>
\ No newline at end of file
diff --git a/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.directive.js b/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.directive.js
new file mode 100644
index 0000000000000000000000000000000000000000..1623d50b273d2d0b5d77cbcd90d22dfaf97c06d2
--- /dev/null
+++ b/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.directive.js
@@ -0,0 +1,26 @@
+/*!
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+/**
+ * Usage:
+ * <div piwik-manage-custom-vars>
+ */
+(function () {
+    angular.module('piwikApp').directive('piwikManageCustomVars', piwikManageCustomVars);
+
+    piwikManageCustomVars.$inject = ['piwik'];
+
+    function piwikManageCustomVars(piwik){
+        return {
+            restrict: 'A',
+            scope: {},
+            templateUrl: 'plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.directive.html?cb=' + piwik.cacheBuster,
+            controller: 'ManageCustomVarsController',
+            controllerAs: 'manageCustomVars'
+        };
+    }
+})();
\ No newline at end of file
diff --git a/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.directive.less b/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.directive.less
new file mode 100644
index 0000000000000000000000000000000000000000..2d3e4e4f04f311774d7a0e418695dd69f1b7e3a7
--- /dev/null
+++ b/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.directive.less
@@ -0,0 +1,10 @@
+.manageCustomVars {
+    .unused {
+        color: @color-silver;
+    }
+
+    .scope, .index {
+        width: 90px;
+        max-width: 90px;
+    }
+}
\ No newline at end of file
diff --git a/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.model.js b/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.model.js
new file mode 100644
index 0000000000000000000000000000000000000000..3cc5b3d4b27960779c21a07b6db1cf6b8f30dbc9
--- /dev/null
+++ b/plugins/CustomVariables/angularjs/manage-custom-vars/manage-custom-vars.model.js
@@ -0,0 +1,36 @@
+/*!
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+(function () {
+    angular.module('piwikApp').factory('manageCustomVarsModel', manageCustomVarsModel);
+
+    manageCustomVarsModel.$inject = ['piwikApi'];
+
+    function manageCustomVarsModel(piwikApi) {
+
+        var model = {
+            customVariables : [],
+            extractions : [],
+            isLoading: false,
+            fetchUsages: fetchUsages
+        };
+
+        return model;
+
+        function fetchUsages() {
+
+            model.isLoading = true;
+
+            piwikApi.fetch({method: 'CustomVariables.getUsagesOfSlots'})
+                .then(function (customVariables) {
+                    model.customVariables = customVariables;
+                })['finally'](function () {    // .finally() is not IE8 compatible see https://github.com/angular/angular.js/commit/f078762d48d0d5d9796dcdf2cb0241198677582c
+                model.isLoading = false;
+            });
+        }
+
+    }
+})();
\ No newline at end of file
diff --git a/plugins/CustomVariables/lang/en.json b/plugins/CustomVariables/lang/en.json
index 7d99f97bf27c1b6204c4b500750f47fedad54ad3..61033b2757591e969285908364009f900b4ce00a 100644
--- a/plugins/CustomVariables/lang/en.json
+++ b/plugins/CustomVariables/lang/en.json
@@ -6,6 +6,16 @@
         "CustomVariablesReportDocumentation": "This report contains information about your Custom Variables. Click on a variable name to see the distribution of the values. %s For more information about Custom Variables in general, read the %sCustom Variables documentation on piwik.org%s",
         "PluginDescription": "Custom Variables are (name, value) pairs that you can assign using the Javascript API to visitors or any of their action. Piwik will then report how many visits, pages, conversions for each of these custom names and values. View the detailed Custom Variables for each user and action in the Visitor Log.<br />Required to use <a href=\"http://piwik.org/docs/ecommerce-analytics/\">Ecommerce Analytics</a> feature!",
         "ScopePage": "scope page",
-        "ScopeVisit": "scope visit"
+        "ScopeVisit": "scope visit",
+        "ManageDescription": "This overview shows all custom variable slots and their usages. The names within each slot are ordered by how often they were used in total.",
+        "Scope": "Scope",
+        "Index": "Index",
+        "Usages": "Usages",
+        "Unused": "Unused",
+        "CreateNewSlot": "Create a new Custom Variable slot",
+        "UsageDetails": "%s visits and %s actions since creation of this website.",
+        "CreatingCustomVariableTakesTime": "Creating a new custom variable slot can take a long time depending on the size of your database. Therefore it is only possible to do this via a command which needs to be executed on the command line.",
+        "CurrentAvailableCustomVariables": "Currently you can use up to %s Custom Variables per site.",
+        "ToCreateCustomVarExecute": "To create a new custom variable slot execute the following command within your Piwik installation: "
     }
 }
\ No newline at end of file
diff --git a/plugins/CustomVariables/templates/manage.twig b/plugins/CustomVariables/templates/manage.twig
new file mode 100644
index 0000000000000000000000000000000000000000..fa7a085aa931cf62d073a92e3bf53df7812c6de5
--- /dev/null
+++ b/plugins/CustomVariables/templates/manage.twig
@@ -0,0 +1,11 @@
+{% extends 'user.twig' %}
+
+{% block topcontrols %}
+    <div class="top_bar_sites_selector piwikTopControl">
+        <div piwik-siteselector class="sites_autocomplete"></div>
+    </div>
+{% endblock %}
+
+{% block content %}
+    <div piwik-manage-custom-vars>
+{% endblock %}
\ No newline at end of file
diff --git a/plugins/CustomVariables/tests/Integration/ModelTest.php b/plugins/CustomVariables/tests/Integration/ModelTest.php
index 128e5b09ef4cec35f5a0fe75de9a4c9fd080f0b8..905a5f6a1da51510ac5cac9054f12bfeeb228e16 100644
--- a/plugins/CustomVariables/tests/Integration/ModelTest.php
+++ b/plugins/CustomVariables/tests/Integration/ModelTest.php
@@ -19,7 +19,7 @@ use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
  */
 class ModelTest extends IntegrationTestCase
 {
-    private static $cvarScopes = array('log_link_visit_action', 'log_visit', 'log_conversion');
+    private static $cvarScopes = array('page', 'visit', 'conversion');
 
     public function setUp()
     {
diff --git a/plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__CustomVariables.getCustomVariables_day.xml b/plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__CustomVariables.getCustomVariables_day.xml
index 3a5683bdc6c66a5692119aa7ca7d025d3c797a16..054f9b1e310c2656ef64f204588d06138705dde0 100644
--- a/plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__CustomVariables.getCustomVariables_day.xml
+++ b/plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__CustomVariables.getCustomVariables_day.xml
@@ -3,6 +3,12 @@
 	<row>
 		<label>Name_PAGE_1</label>
 		<nb_actions>1</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>1</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_PAGE_1</segment>
 		<subtable>
 			<row>
@@ -15,6 +21,12 @@
 	<row>
 		<label>Name_PAGE_2</label>
 		<nb_actions>1</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>2</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_PAGE_2</segment>
 		<subtable>
 			<row>
@@ -27,6 +39,12 @@
 	<row>
 		<label>Name_PAGE_3</label>
 		<nb_actions>1</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>3</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_PAGE_3</segment>
 		<subtable>
 			<row>
@@ -39,6 +57,12 @@
 	<row>
 		<label>Name_PAGE_4</label>
 		<nb_actions>1</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>4</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_PAGE_4</segment>
 		<subtable>
 			<row>
@@ -51,6 +75,12 @@
 	<row>
 		<label>Name_PAGE_5</label>
 		<nb_actions>1</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>5</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_PAGE_5</segment>
 		<subtable>
 			<row>
@@ -63,6 +93,12 @@
 	<row>
 		<label>Name_PAGE_6</label>
 		<nb_actions>1</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>6</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_PAGE_6</segment>
 		<subtable>
 			<row>
@@ -75,6 +111,12 @@
 	<row>
 		<label>Name_PAGE_7</label>
 		<nb_actions>1</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>7</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_PAGE_7</segment>
 		<subtable>
 			<row>
@@ -87,6 +129,12 @@
 	<row>
 		<label>Name_PAGE_8</label>
 		<nb_actions>1</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>8</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_PAGE_8</segment>
 		<subtable>
 			<row>
@@ -113,6 +161,12 @@
 		</goals>
 		<nb_conversions>1</nb_conversions>
 		<revenue>0</revenue>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>1</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_VISIT_1</segment>
 		<subtable>
 			<row>
@@ -152,6 +206,12 @@
 		</goals>
 		<nb_conversions>1</nb_conversions>
 		<revenue>0</revenue>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>2</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_VISIT_2</segment>
 		<subtable>
 			<row>
@@ -191,6 +251,12 @@
 		</goals>
 		<nb_conversions>1</nb_conversions>
 		<revenue>0</revenue>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>3</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_VISIT_3</segment>
 		<subtable>
 			<row>
@@ -230,6 +296,12 @@
 		</goals>
 		<nb_conversions>1</nb_conversions>
 		<revenue>0</revenue>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>4</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_VISIT_4</segment>
 		<subtable>
 			<row>
@@ -269,6 +341,12 @@
 		</goals>
 		<nb_conversions>1</nb_conversions>
 		<revenue>0</revenue>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>5</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_VISIT_5</segment>
 		<subtable>
 			<row>
@@ -308,6 +386,12 @@
 		</goals>
 		<nb_conversions>1</nb_conversions>
 		<revenue>0</revenue>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>6</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_VISIT_6</segment>
 		<subtable>
 			<row>
@@ -347,6 +431,12 @@
 		</goals>
 		<nb_conversions>1</nb_conversions>
 		<revenue>0</revenue>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>7</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_VISIT_7</segment>
 		<subtable>
 			<row>
@@ -386,6 +476,12 @@
 		</goals>
 		<nb_conversions>1</nb_conversions>
 		<revenue>0</revenue>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>8</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Name_VISIT_8</segment>
 		<subtable>
 			<row>
diff --git a/plugins/CustomVariables/tests/UI/.gitignore b/plugins/CustomVariables/tests/UI/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..f39be478e7a412cafbcc27f53a9875baaa92b664
--- /dev/null
+++ b/plugins/CustomVariables/tests/UI/.gitignore
@@ -0,0 +1,2 @@
+/processed-ui-screenshots
+/screenshot-diffs
\ No newline at end of file
diff --git a/plugins/CustomVariables/tests/UI/CustomVariables_spec.js b/plugins/CustomVariables/tests/UI/CustomVariables_spec.js
new file mode 100644
index 0000000000000000000000000000000000000000..a64a1cd7ce8349cf64a968a22b4f0ccbd5fa05c2
--- /dev/null
+++ b/plugins/CustomVariables/tests/UI/CustomVariables_spec.js
@@ -0,0 +1,31 @@
+/*!
+ * Piwik - free/libre analytics platform
+ *
+ * Screenshot integration tests.
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+describe("CustomVariables", function () {
+    this.timeout(0);
+
+    this.fixture = "Piwik\\Plugins\\CustomVariables\\tests\\Fixtures\\VisitWithManyCustomVariables";
+
+    it('should show an overview of all used custom variables', function (done) {
+        expect.screenshot('manage').to.be.captureSelector('.pageWrap', function (page) {
+            page.load("?idSite=1&period=day&date=2010-01-03&module=CustomVariables&action=manage");
+        }, done);
+    });
+
+    it('should be visible in the menu', function (done) {
+        expect.screenshot('link_in_menu').to.be.captureSelector('li:contains(Manage)', function (page) {
+        }, done);
+    });
+
+    it('should show custom variable creation command in dialog', function (done) {
+        expect.screenshot('create').to.be.captureSelector('.ui-dialog', function (page) {
+            page.click('.manageCustomVars .addCustomVar')
+        }, done);
+    });
+});
\ No newline at end of file
diff --git a/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_create.png b/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_create.png
new file mode 100644
index 0000000000000000000000000000000000000000..ccd46cfa9b282160d74b6e3a68f096ca63a02d21
Binary files /dev/null and b/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_create.png differ
diff --git a/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_link_in_menu.png b/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_link_in_menu.png
new file mode 100644
index 0000000000000000000000000000000000000000..95e1c7783d2a13920a16d9493042245cfd09b2c1
Binary files /dev/null and b/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_link_in_menu.png differ
diff --git a/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_manage.png b/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_manage.png
new file mode 100644
index 0000000000000000000000000000000000000000..c520cde1bf581d24ea6dd7993c69e6ba9dfe6a20
Binary files /dev/null and b/plugins/CustomVariables/tests/UI/expected-ui-screenshots/CustomVariables_manage.png differ
diff --git a/tests/PHPUnit/System/expected/test_FlattenReports__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_FlattenReports__CustomVariables.getCustomVariables_day.xml
index c8cd33270553138e0f44126208c64b24e516e9a1..cb25516ca41789c8ca48a69361e24a6b17a3df1b 100644
--- a/tests/PHPUnit/System/expected/test_FlattenReports__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_FlattenReports__CustomVariables.getCustomVariables_day.xml
@@ -4,6 +4,12 @@
 		<row>
 			<label>CustomVarPage</label>
 			<nb_actions>18</nb_actions>
+			<slots>
+				<row>
+					<scope>page</scope>
+					<index>1</index>
+				</row>
+			</slots>
 			<is_aggregate>1</is_aggregate>
 		</row>
 		<row>
@@ -15,6 +21,12 @@
 			<sum_visit_length>6</sum_visit_length>
 			<bounce_count>0</bounce_count>
 			<nb_visits_converted>0</nb_visits_converted>
+			<slots>
+				<row>
+					<scope>visit</scope>
+					<index>1</index>
+				</row>
+			</slots>
 			<is_aggregate>1</is_aggregate>
 		</row>
 		<row>
@@ -68,6 +80,12 @@
 			<sum_visit_length>1</sum_visit_length>
 			<bounce_count>0</bounce_count>
 			<nb_visits_converted>0</nb_visits_converted>
+			<slots>
+				<row>
+					<scope>visit</scope>
+					<index>1</index>
+				</row>
+			</slots>
 			<is_aggregate>1</is_aggregate>
 		</row>
 		<row>
@@ -84,6 +102,12 @@
 		<row>
 			<label>CustomVarPage</label>
 			<nb_actions>1</nb_actions>
+			<slots>
+				<row>
+					<scope>page</scope>
+					<index>1</index>
+				</row>
+			</slots>
 			<is_aggregate>1</is_aggregate>
 		</row>
 		<row>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__CustomVariables.getCustomVariables_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__CustomVariables.getCustomVariables_month.xml
index dc1a11ab2b33c15ead98f4153fd905c4979ed660..a1fea85a41d3c7c7c9d563cb3fd6e6fab76880a3 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__CustomVariables.getCustomVariables_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__CustomVariables.getCustomVariables_month.xml
@@ -3,6 +3,12 @@
 	<row>
 		<label>HTTP-code</label>
 		<nb_actions>43</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>1</index>
+			</row>
+		</slots>
 		<segment>customVariableName==HTTP-code</segment>
 		<subtable>
 			<row>
@@ -61,6 +67,12 @@
 		<revenue>25</revenue>
 		<sum_daily_nb_uniq_visitors>7</sum_daily_nb_uniq_visitors>
 		<sum_daily_nb_users>0</sum_daily_nb_users>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>1</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Not-Bot</segment>
 		<subtable>
 			<row>
@@ -151,6 +163,12 @@
 		<revenue>10</revenue>
 		<sum_daily_nb_uniq_visitors>3</sum_daily_nb_uniq_visitors>
 		<sum_daily_nb_users>1</sum_daily_nb_users>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>1</index>
+			</row>
+		</slots>
 		<segment>customVariableName==User+Name</segment>
 		<subtable>
 			<row>
@@ -196,6 +214,12 @@
 	<row>
 		<label>Generation Time</label>
 		<nb_actions>4</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>1</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Generation+Time</segment>
 		<subtable>
 			<row>
@@ -221,6 +245,12 @@
 	<row>
 		<label>Windows Status Code</label>
 		<nb_actions>4</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>2</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Windows+Status+Code</segment>
 		<subtable>
 			<row>
@@ -267,6 +297,12 @@
 		<revenue>5</revenue>
 		<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 		<sum_daily_nb_users>0</sum_daily_nb_users>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>1</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Bot</segment>
 		<subtable>
 			<row>
@@ -308,6 +344,12 @@
 		<revenue>5</revenue>
 		<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 		<sum_daily_nb_users>0</sum_daily_nb_users>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>3</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Forum+status</segment>
 		<subtable>
 			<row>
@@ -349,6 +391,12 @@
 		<revenue>5</revenue>
 		<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 		<sum_daily_nb_users>0</sum_daily_nb_users>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>5</index>
+			</row>
+		</slots>
 		<segment>customVariableName==VisitorType</segment>
 		<subtable>
 			<row>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__CustomVariables.getUsagesOfSlots.xml b/tests/PHPUnit/System/expected/test_ImportLogs__CustomVariables.getUsagesOfSlots.xml
new file mode 100644
index 0000000000000000000000000000000000000000..002b96ca46fc820bb72426faf5f2c1f4ed605421
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__CustomVariables.getUsagesOfSlots.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<row>
+		<scope>visit</scope>
+		<index>1</index>
+		<usages>
+			<row>
+				<name>Domain landed</name>
+				<nb_visits>12</nb_visits>
+				<nb_actions>16</nb_actions>
+			</row>
+			<row>
+				<name>Not-Bot</name>
+				<nb_visits>7</nb_visits>
+				<nb_actions>10</nb_actions>
+			</row>
+			<row>
+				<name>User Name</name>
+				<nb_visits>3</nb_visits>
+				<nb_actions>5</nb_actions>
+			</row>
+			<row>
+				<name>Bot</name>
+				<nb_visits>1</nb_visits>
+				<nb_actions>1</nb_actions>
+			</row>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>2</index>
+		<usages>
+			<row>
+				<name>Demo language</name>
+				<nb_visits>1</nb_visits>
+				<nb_actions>1</nb_actions>
+			</row>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>3</index>
+		<usages>
+			<row>
+				<name>Forum status</name>
+				<nb_visits>1</nb_visits>
+				<nb_actions>1</nb_actions>
+			</row>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>4</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>5</index>
+		<usages>
+			<row>
+				<name>VisitorType</name>
+				<nb_visits>1</nb_visits>
+				<nb_actions>1</nb_actions>
+			</row>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>1</index>
+		<usages>
+			<row>
+				<name>HTTP-code</name>
+				<nb_visits>0</nb_visits>
+				<nb_actions>69</nb_actions>
+			</row>
+			<row>
+				<name>Generation Time</name>
+				<nb_visits>0</nb_visits>
+				<nb_actions>4</nb_actions>
+			</row>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>2</index>
+		<usages>
+			<row>
+				<name>Windows Status Code</name>
+				<nb_visits>0</nb_visits>
+				<nb_actions>4</nb_actions>
+			</row>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>3</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>4</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>5</index>
+		<usages>
+		</usages>
+	</row>
+</result>
\ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CustomVariables.getUsagesOfSlots.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CustomVariables.getUsagesOfSlots.xml
new file mode 100644
index 0000000000000000000000000000000000000000..81163427e5931b802fd0011c70cc3706ce2dd5b9
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CustomVariables.getUsagesOfSlots.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<row>
+		<scope>visit</scope>
+		<index>1</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>2</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>3</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>4</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>5</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>1</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>2</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>3</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>4</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>5</index>
+		<usages>
+		</usages>
+	</row>
+</result>
\ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__CustomVariables.getUsagesOfSlots.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__CustomVariables.getUsagesOfSlots.xml
new file mode 100644
index 0000000000000000000000000000000000000000..81163427e5931b802fd0011c70cc3706ce2dd5b9
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__CustomVariables.getUsagesOfSlots.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<row>
+		<scope>visit</scope>
+		<index>1</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>2</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>3</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>4</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>5</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>1</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>2</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>3</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>4</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>5</index>
+		<usages>
+		</usages>
+	</row>
+</result>
\ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_day.xml
index 9a056e87868d56fbf26bf8605d71517c8ecbf862..5b6b0bc2553ed723dffe40029126a7fa19e8441d 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_day.xml
@@ -6,6 +6,12 @@
 				<label>_pk_scount</label>
 				<nb_visits>4</nb_visits>
 				<nb_actions>6</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				<segment>customVariableName==_pk_scount</segment>
 				<subtable>
 					<row>
@@ -24,6 +30,12 @@
 				<label>_pk_scat</label>
 				<nb_visits>2</nb_visits>
 				<nb_actions>3</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+				</slots>
 				<segment>customVariableName==_pk_scat</segment>
 				<subtable>
 					<row>
@@ -39,6 +51,12 @@
 				<label>_pk_scount</label>
 				<nb_visits>3</nb_visits>
 				<nb_actions>3</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				<segment>customVariableName==_pk_scount</segment>
 				<subtable>
 					<row>
@@ -62,6 +80,12 @@
 				<label>_pk_scat</label>
 				<nb_visits>2</nb_visits>
 				<nb_actions>2</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+				</slots>
 				<segment>customVariableName==_pk_scat</segment>
 				<subtable>
 					<row>
@@ -89,6 +113,12 @@
 				<label>_pk_scount</label>
 				<nb_visits>1</nb_visits>
 				<nb_actions>2</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				<segment>customVariableName==_pk_scount</segment>
 				<subtable>
 					<row>
@@ -102,6 +132,12 @@
 				<label>_pk_scat</label>
 				<nb_visits>1</nb_visits>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+				</slots>
 				<segment>customVariableName==_pk_scat</segment>
 				<subtable>
 					<row>
@@ -130,6 +166,12 @@
 				<sum_visit_length>541</sum_visit_length>
 				<bounce_count>0</bounce_count>
 				<nb_visits_converted>0</nb_visits_converted>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==test+cvar+name</segment>
 				<subtable>
 					<row>
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_month.xml
index 50b6b4821e56512c7f67fe3019889a55a816fef4..76eae7c657388ae043f36aa2334e7288d6f68f56 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_month.xml
@@ -7,6 +7,12 @@
 				<nb_visits>7</nb_visits>
 				<nb_actions>9</nb_actions>
 				<sum_daily_nb_uniq_visitors>7</sum_daily_nb_uniq_visitors>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				<segment>customVariableName==_pk_scount</segment>
 				<subtable>
 					<row>
@@ -34,6 +40,12 @@
 				<nb_visits>4</nb_visits>
 				<nb_actions>5</nb_actions>
 				<sum_daily_nb_uniq_visitors>4</sum_daily_nb_uniq_visitors>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+				</slots>
 				<segment>customVariableName==_pk_scat</segment>
 				<subtable>
 					<row>
@@ -71,6 +83,12 @@
 				<nb_visits>1</nb_visits>
 				<nb_actions>2</nb_actions>
 				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				<segment>customVariableName==_pk_scount</segment>
 				<subtable>
 					<row>
@@ -86,6 +104,12 @@
 				<nb_visits>1</nb_visits>
 				<nb_actions>1</nb_actions>
 				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+				</slots>
 				<segment>customVariableName==_pk_scat</segment>
 				<subtable>
 					<row>
@@ -116,6 +140,12 @@
 				<nb_visits_converted>0</nb_visits_converted>
 				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 				<sum_daily_nb_users>0</sum_daily_nb_users>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==test+cvar+name</segment>
 				<subtable>
 					<row>
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml
index 96a5e2ca93b91160207d4d265ca855bac071b60f..04b14932b561b8fde9b9efac64522ad756da0ea9 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml
@@ -111,11 +111,23 @@
 	<reportMetadata>
 		<result prettyDate="Sunday, January 3, 2010">
 			<row>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				
 				<segment>customVariableName==_pk_scount</segment>
 				<idsubdatatable>3173</idsubdatatable>
 			</row>
 			<row>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+				</slots>
 				
 				<segment>customVariableName==_pk_scat</segment>
 				<idsubdatatable>3172</idsubdatatable>
@@ -123,11 +135,23 @@
 		</result>
 		<result prettyDate="Monday, January 4, 2010">
 			<row>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				
 				<segment>customVariableName==_pk_scount</segment>
 				<idsubdatatable>3176</idsubdatatable>
 			</row>
 			<row>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+				</slots>
 				
 				<segment>customVariableName==_pk_scat</segment>
 				<idsubdatatable>3175</idsubdatatable>
diff --git a/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml
index 84acfed862456365a53bc24b402de697d4ddbc57..0d9935f4ed1c73816a561562120711c777b0c939 100644
--- a/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml
@@ -80,11 +80,23 @@
 	<reportMetadata>
 		<result prettyDate="January 2010">
 			<row>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				
 				<segment>customVariableName==_pk_scount</segment>
 				<idsubdatatable>3198</idsubdatatable>
 			</row>
 			<row>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+				</slots>
 				
 				<segment>customVariableName==_pk_scat</segment>
 				<idsubdatatable>3197</idsubdatatable>
diff --git a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml
index 1d0ee64c8d067080b684d866ef7bee640c4e3340..caf12153e577fa9fdc50ceebda6fc834620f7f63 100755
--- a/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml
@@ -33,6 +33,12 @@
 		</goals>
 		<nb_conversions>3</nb_conversions>
 		<revenue>3121.11</revenue>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>4</index>
+			</row>
+		</slots>
 		<segment>customVariableName==ValueIsZero</segment>
 		<subtable>
 			<row>
@@ -104,6 +110,12 @@
 		</goals>
 		<nb_conversions>3</nb_conversions>
 		<revenue>3121.11</revenue>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>5</index>
+			</row>
+		</slots>
 		<segment>customVariableName==VisitorType</segment>
 		<subtable>
 			<row>
@@ -146,6 +158,12 @@
 		<label>_pkc</label>
 		<nb_visits>7</nb_visits>
 		<nb_actions>12</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>5</index>
+			</row>
+		</slots>
 		<segment>customVariableName==_pkc</segment>
 		<subtable>
 			<row>
@@ -191,6 +209,12 @@
 		<label>_pkn</label>
 		<nb_visits>6</nb_visits>
 		<nb_actions>11</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>4</index>
+			</row>
+		</slots>
 		<segment>customVariableName==_pkn</segment>
 		<subtable>
 			<row>
@@ -216,6 +240,12 @@
 		<label>_pks</label>
 		<nb_visits>6</nb_visits>
 		<nb_actions>11</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>3</index>
+			</row>
+		</slots>
 		<segment>customVariableName==_pks</segment>
 		<subtable>
 			<row>
@@ -265,6 +295,12 @@
 		</goals>
 		<nb_conversions>2</nb_conversions>
 		<revenue>3111.11</revenue>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>3</index>
+			</row>
+		</slots>
 		<segment>customVariableName==VisitorName</segment>
 		<subtable>
 			<row>
@@ -302,6 +338,12 @@
 		<label>_pkp</label>
 		<nb_visits>8</nb_visits>
 		<nb_actions>8</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>2</index>
+			</row>
+		</slots>
 		<segment>customVariableName==_pkp</segment>
 		<subtable>
 			<row>
diff --git a/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CustomVariables.getUsagesOfSlots.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CustomVariables.getUsagesOfSlots.xml
new file mode 100644
index 0000000000000000000000000000000000000000..81163427e5931b802fd0011c70cc3706ce2dd5b9
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CustomVariables.getUsagesOfSlots.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<row>
+		<scope>visit</scope>
+		<index>1</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>2</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>3</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>4</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>5</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>1</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>2</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>3</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>4</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>5</index>
+		<usages>
+		</usages>
+	</row>
+</result>
\ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_noVisit__CustomVariables.getUsagesOfSlots.xml b/tests/PHPUnit/System/expected/test_noVisit__CustomVariables.getUsagesOfSlots.xml
new file mode 100644
index 0000000000000000000000000000000000000000..81163427e5931b802fd0011c70cc3706ce2dd5b9
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_noVisit__CustomVariables.getUsagesOfSlots.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<row>
+		<scope>visit</scope>
+		<index>1</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>2</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>3</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>4</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>visit</scope>
+		<index>5</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>1</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>2</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>3</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>4</index>
+		<usages>
+		</usages>
+	</row>
+	<row>
+		<scope>page</scope>
+		<index>5</index>
+		<usages>
+		</usages>
+	</row>
+</result>
\ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml
index 00acc7d7d0ff63b46335ed672ecaa6cec6386179..8851c23d9a333edf649d60c06168ad7bbc35e7dc 100644
--- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml
@@ -23,6 +23,12 @@
 		<revenue>1000</revenue>
 		<sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
 		<sum_daily_nb_users>0</sum_daily_nb_users>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>1</index>
+			</row>
+		</slots>
 		<segment>customVariableName==VisitorType</segment>
 		<subtable>
 			<row>
@@ -88,6 +94,12 @@
 		<revenue>0</revenue>
 		<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 		<sum_daily_nb_users>0</sum_daily_nb_users>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>2</index>
+			</row>
+		</slots>
 		<segment>customVariableName==SET+WITH+EMPTY+VALUE</segment>
 		<subtable>
 			<row>
@@ -114,6 +126,16 @@
 	<row>
 		<label>Status user</label>
 		<nb_actions>3</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>4</index>
+			</row>
+			<row>
+				<scope>page</scope>
+				<index>5</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Status+user</segment>
 		<subtable>
 			<row>
@@ -148,6 +170,12 @@
 		<revenue>0</revenue>
 		<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 		<sum_daily_nb_users>0</sum_daily_nb_users>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>3</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Value+will+be+VERY+long+and+truncated</segment>
 		<subtable>
 			<row>
@@ -189,6 +217,12 @@
 		<revenue>1000</revenue>
 		<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 		<sum_daily_nb_users>0</sum_daily_nb_users>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>2</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Othercustom+value+which+should+be+truncated+abcdefghijklmnopqrstuvwxyz</segment>
 		<subtable>
 			<row>
@@ -215,6 +249,12 @@
 	<row>
 		<label>Language</label>
 		<nb_actions>1</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>1</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Language</segment>
 		<subtable>
 			<row>
@@ -228,6 +268,12 @@
 	<row>
 		<label>SET WITH EMPTY VALUE PAGE SCOPE</label>
 		<nb_actions>1</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>2</index>
+			</row>
+		</slots>
 		<segment>customVariableName==SET+WITH+EMPTY+VALUE+PAGE+SCOPE</segment>
 		<subtable>
 			<row>
diff --git a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__CustomVariables.getCustomVariables_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__CustomVariables.getCustomVariables_range.xml
index 00acc7d7d0ff63b46335ed672ecaa6cec6386179..8851c23d9a333edf649d60c06168ad7bbc35e7dc 100644
--- a/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__CustomVariables.getCustomVariables_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__CustomVariables.getCustomVariables_range.xml
@@ -23,6 +23,12 @@
 		<revenue>1000</revenue>
 		<sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
 		<sum_daily_nb_users>0</sum_daily_nb_users>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>1</index>
+			</row>
+		</slots>
 		<segment>customVariableName==VisitorType</segment>
 		<subtable>
 			<row>
@@ -88,6 +94,12 @@
 		<revenue>0</revenue>
 		<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 		<sum_daily_nb_users>0</sum_daily_nb_users>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>2</index>
+			</row>
+		</slots>
 		<segment>customVariableName==SET+WITH+EMPTY+VALUE</segment>
 		<subtable>
 			<row>
@@ -114,6 +126,16 @@
 	<row>
 		<label>Status user</label>
 		<nb_actions>3</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>4</index>
+			</row>
+			<row>
+				<scope>page</scope>
+				<index>5</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Status+user</segment>
 		<subtable>
 			<row>
@@ -148,6 +170,12 @@
 		<revenue>0</revenue>
 		<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 		<sum_daily_nb_users>0</sum_daily_nb_users>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>3</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Value+will+be+VERY+long+and+truncated</segment>
 		<subtable>
 			<row>
@@ -189,6 +217,12 @@
 		<revenue>1000</revenue>
 		<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 		<sum_daily_nb_users>0</sum_daily_nb_users>
+		<slots>
+			<row>
+				<scope>visit</scope>
+				<index>2</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Othercustom+value+which+should+be+truncated+abcdefghijklmnopqrstuvwxyz</segment>
 		<subtable>
 			<row>
@@ -215,6 +249,12 @@
 	<row>
 		<label>Language</label>
 		<nb_actions>1</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>1</index>
+			</row>
+		</slots>
 		<segment>customVariableName==Language</segment>
 		<subtable>
 			<row>
@@ -228,6 +268,12 @@
 	<row>
 		<label>SET WITH EMPTY VALUE PAGE SCOPE</label>
 		<nb_actions>1</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>2</index>
+			</row>
+		</slots>
 		<segment>customVariableName==SET+WITH+EMPTY+VALUE+PAGE+SCOPE</segment>
 		<subtable>
 			<row>
diff --git a/tests/PHPUnit/System/expected/test_reportLimiting__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__CustomVariables.getCustomVariables_day.xml
index 6b7a4a8b1c2e5ebb12b2371e366baf7ba1a31f6f..c1ba006247f5336104ed45a9750e6d6720b8b010 100644
--- a/tests/PHPUnit/System/expected/test_reportLimiting__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__CustomVariables.getCustomVariables_day.xml
@@ -3,6 +3,12 @@
 	<row>
 		<label>liked</label>
 		<nb_actions>20</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>4</index>
+			</row>
+		</slots>
 		<segment>customVariableName==liked</segment>
 		<subtable>
 			<row>
@@ -20,6 +26,12 @@
 	<row>
 		<label>tweeted</label>
 		<nb_actions>20</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>3</index>
+			</row>
+		</slots>
 		<segment>customVariableName==tweeted</segment>
 		<subtable>
 			<row>
diff --git a/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__CustomVariables.getCustomVariables_day.xml
index 6b7a4a8b1c2e5ebb12b2371e366baf7ba1a31f6f..c1ba006247f5336104ed45a9750e6d6720b8b010 100644
--- a/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__CustomVariables.getCustomVariables_day.xml
@@ -3,6 +3,12 @@
 	<row>
 		<label>liked</label>
 		<nb_actions>20</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>4</index>
+			</row>
+		</slots>
 		<segment>customVariableName==liked</segment>
 		<subtable>
 			<row>
@@ -20,6 +26,12 @@
 	<row>
 		<label>tweeted</label>
 		<nb_actions>20</nb_actions>
+		<slots>
+			<row>
+				<scope>page</scope>
+				<index>3</index>
+			</row>
+		</slots>
 		<segment>customVariableName==tweeted</segment>
 		<subtable>
 			<row>
diff --git a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_day.xml
index ebbd07023b7768573bb46ab3cffa72a63408cd83..7ffb6725e4c97e6eea14e1d691e63ef3c5021426 100644
--- a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_day.xml
@@ -24,6 +24,12 @@
 				</goals>
 				<nb_conversions>3</nb_conversions>
 				<revenue>1000</revenue>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==VisitorType</segment>
 				<subtable>
 					<row>
@@ -86,6 +92,12 @@
 				</goals>
 				<nb_conversions>1</nb_conversions>
 				<revenue>0</revenue>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==SET+WITH+EMPTY+VALUE</segment>
 				<subtable>
 					<row>
@@ -125,6 +137,12 @@
 				</goals>
 				<nb_conversions>1</nb_conversions>
 				<revenue>0</revenue>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>3</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Value+will+be+VERY+long+and+truncated</segment>
 				<subtable>
 					<row>
@@ -150,6 +168,16 @@
 			<row>
 				<label>Status user</label>
 				<nb_actions>3</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Status+user</segment>
 				<subtable>
 					<row>
@@ -181,6 +209,12 @@
 				</goals>
 				<nb_conversions>1</nb_conversions>
 				<revenue>1000</revenue>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Othercustom+value+which+should+be+truncated+abcdefghijklmnopqrstuvwxyz</segment>
 				<subtable>
 					<row>
@@ -206,6 +240,12 @@
 			<row>
 				<label>Language</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Language</segment>
 				<subtable>
 					<row>
@@ -218,6 +258,12 @@
 			<row>
 				<label>SET WITH EMPTY VALUE PAGE SCOPE</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==SET+WITH+EMPTY+VALUE+PAGE+SCOPE</segment>
 				<subtable>
 					<row>
@@ -230,6 +276,12 @@
 			<row>
 				<label>var1</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==var1</segment>
 				<subtable>
 					<row>
@@ -242,6 +294,12 @@
 			<row>
 				<label>var2</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>3</index>
+					</row>
+				</slots>
 				<segment>customVariableName==var2</segment>
 				<subtable>
 					<row>
@@ -254,6 +312,12 @@
 			<row>
 				<label>var3</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+				</slots>
 				<segment>customVariableName==var3</segment>
 				<subtable>
 					<row>
diff --git a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_week.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_week.xml
index 92a4a5c7be5e2bbbf7dbad520fef8492ac9b60df..0514b1d5d39da1dfd67e923b708e48b8d7185833 100644
--- a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_week.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_week.xml
@@ -25,6 +25,12 @@
 				<revenue>1000</revenue>
 				<sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
 				<sum_daily_nb_users>0</sum_daily_nb_users>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==VisitorType</segment>
 				<subtable>
 					<row>
@@ -90,6 +96,12 @@
 				<revenue>0</revenue>
 				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 				<sum_daily_nb_users>0</sum_daily_nb_users>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==SET+WITH+EMPTY+VALUE</segment>
 				<subtable>
 					<row>
@@ -131,6 +143,12 @@
 				<revenue>0</revenue>
 				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 				<sum_daily_nb_users>0</sum_daily_nb_users>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>3</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Value+will+be+VERY+long+and+truncated</segment>
 				<subtable>
 					<row>
@@ -157,6 +175,16 @@
 			<row>
 				<label>Status user</label>
 				<nb_actions>3</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Status+user</segment>
 				<subtable>
 					<row>
@@ -191,6 +219,12 @@
 				<revenue>1000</revenue>
 				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 				<sum_daily_nb_users>0</sum_daily_nb_users>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Othercustom+value+which+should+be+truncated+abcdefghijklmnopqrstuvwxyz</segment>
 				<subtable>
 					<row>
@@ -217,6 +251,12 @@
 			<row>
 				<label>Language</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Language</segment>
 				<subtable>
 					<row>
@@ -230,6 +270,12 @@
 			<row>
 				<label>SET WITH EMPTY VALUE PAGE SCOPE</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==SET+WITH+EMPTY+VALUE+PAGE+SCOPE</segment>
 				<subtable>
 					<row>
@@ -243,6 +289,12 @@
 			<row>
 				<label>var1</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==var1</segment>
 				<subtable>
 					<row>
@@ -256,6 +308,12 @@
 			<row>
 				<label>var2</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>3</index>
+					</row>
+				</slots>
 				<segment>customVariableName==var2</segment>
 				<subtable>
 					<row>
@@ -269,6 +327,12 @@
 			<row>
 				<label>var3</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+				</slots>
 				<segment>customVariableName==var3</segment>
 				<subtable>
 					<row>
diff --git a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_day.xml
index 7e941dea109397c827dc6265d48e115279cc8b8d..1bfb23612e9594dafc49f017558ec5c4030a364c 100644
--- a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_day.xml
@@ -24,6 +24,12 @@
 				</goals>
 				<nb_conversions>3</nb_conversions>
 				<revenue>1000</revenue>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==VisitorType</segment>
 				<subtable>
 					<row>
@@ -86,6 +92,12 @@
 				</goals>
 				<nb_conversions>1</nb_conversions>
 				<revenue>0</revenue>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==SET+WITH+EMPTY+VALUE</segment>
 				<subtable>
 					<row>
@@ -111,6 +123,16 @@
 			<row>
 				<label>Status user</label>
 				<nb_actions>3</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Status+user</segment>
 				<subtable>
 					<row>
@@ -142,6 +164,12 @@
 				</goals>
 				<nb_conversions>1</nb_conversions>
 				<revenue>0</revenue>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>3</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Value+will+be+VERY+long+and+truncated</segment>
 				<subtable>
 					<row>
@@ -181,6 +209,12 @@
 				</goals>
 				<nb_conversions>1</nb_conversions>
 				<revenue>1000</revenue>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Othercustom+value+which+should+be+truncated+abcdefghijklmnopqrstuvwxyz</segment>
 				<subtable>
 					<row>
@@ -206,6 +240,12 @@
 			<row>
 				<label>Language</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Language</segment>
 				<subtable>
 					<row>
@@ -218,6 +258,12 @@
 			<row>
 				<label>SET WITH EMPTY VALUE PAGE SCOPE</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==SET+WITH+EMPTY+VALUE+PAGE+SCOPE</segment>
 				<subtable>
 					<row>
diff --git a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_week.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_week.xml
index 54f91c076fbd1bc04c5df1f83d721b0485037143..4041ca8eacd4b73c9b1e8e9cacebd100487a23f0 100644
--- a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_week.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_week.xml
@@ -25,6 +25,12 @@
 				<revenue>1000</revenue>
 				<sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
 				<sum_daily_nb_users>0</sum_daily_nb_users>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==VisitorType</segment>
 				<subtable>
 					<row>
@@ -90,6 +96,12 @@
 				<revenue>0</revenue>
 				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 				<sum_daily_nb_users>0</sum_daily_nb_users>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==SET+WITH+EMPTY+VALUE</segment>
 				<subtable>
 					<row>
@@ -116,6 +128,16 @@
 			<row>
 				<label>Status user</label>
 				<nb_actions>3</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Status+user</segment>
 				<subtable>
 					<row>
@@ -150,6 +172,12 @@
 				<revenue>0</revenue>
 				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 				<sum_daily_nb_users>0</sum_daily_nb_users>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>3</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Value+will+be+VERY+long+and+truncated</segment>
 				<subtable>
 					<row>
@@ -191,6 +219,12 @@
 				<revenue>1000</revenue>
 				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 				<sum_daily_nb_users>0</sum_daily_nb_users>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Othercustom+value+which+should+be+truncated+abcdefghijklmnopqrstuvwxyz</segment>
 				<subtable>
 					<row>
@@ -217,6 +251,12 @@
 			<row>
 				<label>Language</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Language</segment>
 				<subtable>
 					<row>
@@ -230,6 +270,12 @@
 			<row>
 				<label>SET WITH EMPTY VALUE PAGE SCOPE</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==SET+WITH+EMPTY+VALUE+PAGE+SCOPE</segment>
 				<subtable>
 					<row>
diff --git a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_day.xml
index 304bb2fe6551fc775275287e1f7e431188313b81..428f0180aec1cf6c1f87349df337deba0144ad0a 100644
--- a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_day.xml
@@ -19,6 +19,12 @@
 				</goals>
 				<nb_conversions>1</nb_conversions>
 				<revenue>0</revenue>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==SET+WITH+EMPTY+VALUE</segment>
 				<subtable>
 					<row>
@@ -44,6 +50,16 @@
 			<row>
 				<label>Status user</label>
 				<nb_actions>3</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Status+user</segment>
 				<subtable>
 					<row>
@@ -75,6 +91,12 @@
 				</goals>
 				<nb_conversions>1</nb_conversions>
 				<revenue>0</revenue>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>3</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Value+will+be+VERY+long+and+truncated</segment>
 				<subtable>
 					<row>
@@ -119,6 +141,12 @@
 				</goals>
 				<nb_conversions>2</nb_conversions>
 				<revenue>0</revenue>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==VisitorType</segment>
 				<subtable>
 					<row>
@@ -157,6 +185,12 @@
 			<row>
 				<label>Language</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Language</segment>
 				<subtable>
 					<row>
@@ -169,6 +203,12 @@
 			<row>
 				<label>SET WITH EMPTY VALUE PAGE SCOPE</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==SET+WITH+EMPTY+VALUE+PAGE+SCOPE</segment>
 				<subtable>
 					<row>
diff --git a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_week.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_week.xml
index c4f92b8e6b78b68efcf7268d2058d2aa27d5b9ba..4c0da8f95e92c1f64835f450d0d56691aa95e27d 100644
--- a/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_week.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_week.xml
@@ -20,6 +20,12 @@
 				<revenue>0</revenue>
 				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 				<sum_daily_nb_users>0</sum_daily_nb_users>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==SET+WITH+EMPTY+VALUE</segment>
 				<subtable>
 					<row>
@@ -46,6 +52,16 @@
 			<row>
 				<label>Status user</label>
 				<nb_actions>3</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>4</index>
+					</row>
+					<row>
+						<scope>page</scope>
+						<index>5</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Status+user</segment>
 				<subtable>
 					<row>
@@ -80,6 +96,12 @@
 				<revenue>0</revenue>
 				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 				<sum_daily_nb_users>0</sum_daily_nb_users>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>3</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Value+will+be+VERY+long+and+truncated</segment>
 				<subtable>
 					<row>
@@ -126,6 +148,12 @@
 				<revenue>0</revenue>
 				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 				<sum_daily_nb_users>0</sum_daily_nb_users>
+				<slots>
+					<row>
+						<scope>visit</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==VisitorType</segment>
 				<subtable>
 					<row>
@@ -165,6 +193,12 @@
 			<row>
 				<label>Language</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>1</index>
+					</row>
+				</slots>
 				<segment>customVariableName==Language</segment>
 				<subtable>
 					<row>
@@ -178,6 +212,12 @@
 			<row>
 				<label>SET WITH EMPTY VALUE PAGE SCOPE</label>
 				<nb_actions>1</nb_actions>
+				<slots>
+					<row>
+						<scope>page</scope>
+						<index>2</index>
+					</row>
+				</slots>
 				<segment>customVariableName==SET+WITH+EMPTY+VALUE+PAGE+SCOPE</segment>
 				<subtable>
 					<row>
diff --git a/tests/PHPUnit/Unit/DataTable/Renderer/CSVTest.php b/tests/PHPUnit/Unit/DataTable/Renderer/CSVTest.php
index c6fd94e40667f052d03a3e25698a13b8ea6b7770..057f500d189f7f21a388eefa2defafd2edf800fc 100644
--- a/tests/PHPUnit/Unit/DataTable/Renderer/CSVTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Renderer/CSVTest.php
@@ -96,6 +96,22 @@ class DataTable_Renderer_CSVTest extends \PHPUnit_Framework_TestCase
         return $table;
     }
 
+    protected function _getDataTableHavingAnArrayInRowMetadata()
+    {
+        $array = array(
+            array(Row::COLUMNS => array('label' => 'sub1', 'count' => 1)),
+            array(Row::COLUMNS => array('label' => 'sub2', 'count' => 2), Row::METADATA => array('test' => 'render')),
+            array(Row::COLUMNS => array('label' => 'sub3', 'count' => 2), Row::METADATA => array('test' => 'renderMe', 'testArray' => 'ignore')),
+            array(Row::COLUMNS => array('label' => 'sub4', 'count' => 6), Row::METADATA => array('testArray' => array('do not render'))),
+            array(Row::COLUMNS => array('label' => 'sub5', 'count' => 2), Row::METADATA => array('testArray' => 'do ignore', 'mymeta' => 'should be rendered')),
+            array(Row::COLUMNS => array('label' => 'sub6', 'count' => 3), Row::METADATA => array('mymeta' => 'renderrrrrr')),
+        );
+
+        $table = new DataTable();
+        $table->addRowsFromArray($array);
+
+        return $table;
+    }
 
     public function testCSVTest1()
     {
@@ -186,6 +202,25 @@ class DataTable_Renderer_CSVTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals($expected, $actual);
     }
 
+    public function testCSVTest7_shouldNotRenderMetadataThatContainsAnArray()
+    {
+        $dataTable = $this->_getDataTableHavingAnArrayInRowMetadata();
+        $render = new Csv();
+        $render->setTable($dataTable);
+        $render->convertToUnicode = false;
+
+        // the column "testArray" should be ignored and not rendered, all other columns should be assigned correctly
+        $expected = "label,count,metadata_test,metadata_mymeta
+sub1,1,,
+sub2,2,render,
+sub3,2,renderMe,
+sub4,6,,
+sub5,2,,should be rendered
+sub6,3,,renderrrrrr";
+        $rendered = $render->render();
+        $this->assertEquals($expected, $rendered);
+    }
+
     /**
      * DATA OF DATATABLE_ARRAY
      * -------------------------