diff --git a/misc/log-analytics/import_logs.py b/misc/log-analytics/import_logs.py
index 2e22afa341e54291a988a04b23a9625cbf179f3d..d129d9c4cd583d3000b2b4df05d7e9e4945df389 100755
--- a/misc/log-analytics/import_logs.py
+++ b/misc/log-analytics/import_logs.py
@@ -162,6 +162,10 @@ class JsonFormat(BaseFormat):
     def get_all(self,):
         return self.json
 
+    def remove_ignored_groups(self, groups):
+        for group in groups:
+            del self.json[group]
+
 class RegexFormat(BaseFormat):
 
     def __init__(self, name, regex, date_format=None):
@@ -176,17 +180,25 @@ class RegexFormat(BaseFormat):
         return self.match(line)
 
     def match(self,line):
-        self.matched = self.regex.match(line)
-        return self.matched
+        match_result = self.regex.match(line)
+        if match_result:
+            self.matched = match_result.groupdict()
+        else:
+            self.matched = None
+        return match_result
 
     def get(self, key):
         try:
-            return self.matched.group(key)
-        except IndexError:
+            return self.matched[key]
+        except KeyError:
             raise BaseFormatException()
 
     def get_all(self,):
-        return self.matched.groupdict()
+        return self.matched
+
+    def remove_ignored_groups(self, groups):
+        for group in groups:
+            del self.matched[group]
 
 class W3cExtendedFormat(RegexFormat):
 
@@ -316,9 +328,9 @@ class AmazonCloudFrontFormat(W3cExtendedFormat):
         self.name = 'amazon_cloudfront'
 
     def get(self, key):
-        if key == 'event_category' and 'event_category' not in self.matched.groupdict():
+        if key == 'event_category' and 'event_category' not in self.matched:
             return 'cloudfront_rtmp'
-        elif key == 'status' and 'status' not in self.matched.groupdict():
+        elif key == 'status' and 'status' not in self.matched:
             return '200'
         else:
             return super(AmazonCloudFrontFormat, self).get(key)
@@ -381,6 +393,7 @@ class Configuration(object):
                    "              Found a bug? Please create a ticket in http://dev.piwik.org/ "
                    "              Please send your suggestions or successful user story to hello@piwik.org "
         )
+
         option_parser.add_option(
             '--debug', '-d', dest='debug', action='count', default=0,
             help="Enable debug output (specify multiple times for more verbose)",
@@ -516,10 +529,14 @@ class Configuration(object):
                   "When not specified, the log format will be autodetected by trying all supported log formats."
                   % ', '.join(sorted(FORMATS.iterkeys())))
         )
+        available_regex_groups = ['date', 'path', 'query_string', 'ip', 'user_agent', 'referrer', 'status',
+                                  'length', 'host', 'userid', 'generation_time_milli', 'event_action',
+                                  'event_name', 'timezone', 'session_time']
         option_parser.add_option(
             '--log-format-regex', dest='log_format_regex', default=None,
-            help="Access log regular expression. For an example of a supported Regex, see the source code of this file. "
-                 "Overrides --log-format-name"
+            help="Regular expression used to parse log entries. Regexes must contain named groups for different log fields. "
+                 "Recognized fields include: %s. For an example of a supported Regex, see the source code of this file. "
+                 "Overrides --log-format-name." % (', '.join(available_regex_groups))
         )
         option_parser.add_option(
             '--log-hostname', dest='log_hostname', default=None,
@@ -613,19 +630,29 @@ class Configuration(object):
                  "in newer versions of the script in older versions of the script. The output regex can be used with "
                  "the --log-format-regex option."
         )
+
+        option_parser.add_option(
+            '--ignore-groups', dest='regex_groups_to_ignore', default=None,
+            help="Comma separated list of regex groups to ignore when parsing log lines. Can be used to, for example, "
+                 "disable normal user id tracking. See documentation for --log-format-regex for list of available "
+                 "regex groups."
+        )
+
         option_parser.add_option(
-            '--api-arg-to-visit-cvar', action='callback', callback=functools.partial(self._set_option_map, 'api_args_to_visit_cvars_map'), type='string',
+            '--regex-group-to-visit-cvar', action='callback', callback=functools.partial(self._set_option_map, 'regex_group_to_visit_cvars_map'), type='string',
             help="Track an attribute through a custom variable with visit scope instead of through Piwik's normal "
                  "approach. For example, to track usernames as a custom variable instead of through the uid tracking "
-                 "parameter, supply --api-arg-to-visit-cvar=\"uid=User Name\". This will track usernames in a "
-                 "custom variable named 'User Name'."
+                 "parameter, supply --regex-group-to-visit-cvar=\"userid=User Name\". This will track usernames in a "
+                 "custom variable named 'User Name'. See documentation for --log-format-regex for list of available "
+                 "regex groups."
         )
         option_parser.add_option(
-            '--api-arg-to-page-cvar', action='callback', callback=functools.partial(self._set_option_map, 'api_args_to_page_cvars_map'), type='string',
+            '--regex-group-to-page-cvar', action='callback', callback=functools.partial(self._set_option_map, 'regex_group_to_page_cvars_map'), type='string',
             help="Track an attribute through a custom variable with page scope instead of through Piwik's normal "
                  "approach. For example, to track usernames as a custom variable instead of through the uid tracking "
-                 "parameter, supply --api-arg-to-page-cvar=\"uid=User Name\". This will track usernames in a "
-                 "custom variable named 'User Name'."
+                 "parameter, supply --regex-group-to-page-cvar=\"userid=User Name\". This will track usernames in a "
+                 "custom variable named 'User Name'. See documentation for --log-format-regex for list of available "
+                 "regex groups."
         )
         return option_parser
 
@@ -707,11 +734,11 @@ class Configuration(object):
                     fatal_error("custom W3C field mapping error: don't know how to parse and use the '%' field" % default_name)
                     return
 
-        if not hasattr(self.options, 'api_args_to_visit_cvars_map'):
-            self.options.api_args_to_visit_cvars_map = {}
+        if not hasattr(self.options, 'regex_group_to_visit_cvars_map'):
+            self.options.regex_group_to_visit_cvars_map = {}
 
-        if not hasattr(self.options, 'api_args_to_page_cvars_map'):
-            self.options.api_args_to_page_cvars_map = {}
+        if not hasattr(self.options, 'regex_group_to_page_cvars_map'):
+            self.options.regex_group_to_page_cvars_map = {}
 
         if not self.options.piwik_url:
             fatal_error('no URL given for Piwik')
@@ -735,6 +762,9 @@ class Configuration(object):
         else:
             self.options.download_extensions = DOWNLOAD_EXTENSIONS
 
+        if self.options.regex_groups_to_ignore:
+            self.options.regex_groups_to_ignore = set(self.options.regex_groups_to_ignore.split())
+
     def __init__(self):
         self._parse_args(self._create_parser())
 
@@ -1417,6 +1447,15 @@ class Recorder(object):
         # only prepend main url if it's a path
         url = (main_url if path.startswith('/') else '') + path[:1024]
 
+        # handle custom variables before generating args dict
+        if config.options.enable_bots:
+            if hit.is_robot:
+                hit.add_visit_custom_var("Bot", hit.user_agent)
+            else:
+                hit.add_visit_custom_var("Not-Bot", hit.user_agent)
+
+        hit.add_page_custom_var("HTTP-code", hit.status)
+
         args = {
             'rec': '1',
             'apiv': '1',
@@ -1440,14 +1479,6 @@ class Recorder(object):
 
         if config.options.enable_bots:
             args['bots'] = '1'
-            if hit.is_robot:
-                args['_cvar'] = {"1": ["Bot", hit.user_agent]}
-            else:
-                args['_cvar'] = {"1": ["Not-Bot", hit.user_agent]}
-
-        # do not overwrite custom variables if it's already set (eg. when replaying ecommerce logs)
-        if 'cvar' not in args:
-            args['cvar'] = {"1": ["HTTP-code", hit.status]}
 
         if hit.is_error or hit.is_redirect:
 			args['action_name'] = '%s%sURL = %s%s' % (
@@ -1473,14 +1504,6 @@ class Recorder(object):
         if hit.length:
             args['bw_bytes'] = hit.length
 
-        if config.options.api_args_to_page_cvars_map:
-            args['cvar'] = self._get_api_args_custom_variables(
-                args.get('cvar', {}), config.options.api_args_to_page_cvars_map, args)
-
-        if config.options.api_args_to_visit_cvars_map:
-            args['_cvar'] = self._get_api_args_custom_variables(
-                args.get('_cvar', {}), config.options.api_args_to_visit_cvars_map, args)
-
         # convert custom variable args to JSON
         if 'cvar' in args and not isinstance(args['cvar'], basestring):
             args['cvar'] = json.dumps(args['cvar'])
@@ -1490,23 +1513,6 @@ class Recorder(object):
 
         return args
 
-    def _get_api_args_custom_variables(self, custom_vars, api_args_to_cvars_map, request_args):
-        """
-        Handles the --api-arg-to-...-cvar options by moving API request query parameters to
-        a custom variables data structure. The data structure is returned and can be used in
-        the cvar and _cvar query parameters.
-        """
-        # TODO: test not overwriting existing 'cvars'...
-        for api_arg_name, cvar_key in api_args_to_cvars_map.iteritems():
-            if api_arg_name in request_args:
-                custom_var_num = len(custom_vars) + 1
-                custom_vars[custom_var_num] = [cvar_key, request_args[api_arg_name]]
-
-                del request_args[api_arg_name]
-            else:
-                pass
-        return custom_vars
-
     def _record_hits(self, hits):
         """
         Inserts several hits into Piwik.
@@ -1573,6 +1579,29 @@ class Hit(object):
 
         return abs(hash(visitor_id))
 
+    def add_page_custom_var(self, key, value):
+        """
+        Adds a page custom variable to this Hit.
+        """
+        self._add_custom_var(key, value, 'cvar')
+
+    def add_visit_custom_var(self, key, value):
+        """
+        Adds a visit custom variable to this Hit.
+        """
+        self._add_custom_var(key, value, '_cvar')
+
+    def _add_custom_var(self, key, value, api_arg_name):
+        if api_arg_name not in self.args:
+            self.args[api_arg_name] = {}
+
+        if isinstance(self.args[api_arg_name], basestring):
+            logging.debug("Ignoring custom %s variable addition [ %s = %s ], custom var already set to string." % (api_arg_name, key, value))
+            return
+
+        index = len(self.args[api_arg_name]) + 1
+        self.args[api_arg_name][index] = [key, value]
+
 class Parser(object):
     """
     The Parser parses the lines in a specified file and inserts them into
@@ -1842,6 +1871,15 @@ class Parser(object):
                 args={},
             )
 
+            if config.options.regex_group_to_page_cvars_map:
+                self._add_custom_vars_from_regex_groups(hit, format, config.options.regex_group_to_page_cvars_map, True)
+
+            if config.options.regex_group_to_visit_cvars_map:
+                self._add_custom_vars_from_regex_groups(hit, format, config.options.regex_group_to_visit_cvars_map, False)
+
+            if config.options.regex_groups_to_ignore:
+                format.remove_ignored_groups(config.options.regex_groups_to_ignore)
+
             try:
                 hit.query_string = format.get('query_string')
                 hit.path = hit.full_path
@@ -1980,6 +2018,14 @@ class Parser(object):
         if len(hits) > 0:
             Recorder.add_hits(hits)
 
+    def _add_custom_vars_from_regex_groups(self, hit, format, groups, is_page_var):
+        for group_name, custom_var_name in groups.iteritems():
+            if group_name in format.get_all():
+                if is_page_var:
+                    hit.add_page_custom_var(custom_var_name, format.get(group_name))
+                else:
+                    hit.add_visit_custom_var(custom_var_name, format.get(group_name))
+
 def main():
     """
     Start the importing process.
diff --git a/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php b/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php
index 853020e2e113be295a55490da7ad8b5274040f40..1dd043200fb4f2e5361c9e652c3482392eff2c36 100644
--- a/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php
+++ b/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php
@@ -271,8 +271,9 @@ class ManySitesImportedLogs extends Fixture
                       '--enable-http-redirects'     => false);
 
         if ($mapToCustom) {
-            $opts['--api-arg-to-visit-cvar'] = 'uid=User Name';
-            $opts['--api-arg-to-page-cvar'] = 'gt_ms=Generation Time';
+            $opts['--regex-group-to-visit-cvar'] = 'userid=User Name';
+            $opts['--regex-group-to-page-cvar'] = 'generation_time_milli=Generation Time';
+            $opts['--ignore-groups'] = 'userid';
         }
 
         self::executeLogImporter($logFile, $opts);
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_month.xml
index be865a37d790efe5d84cc441e7e75f1d1c53f1ad..a67474528f752bf2bcd5449a23a08143f630305d 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_month.xml
@@ -57,7 +57,7 @@
 		<nb_visits>3</nb_visits>
 		<nb_hits>3</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 		<min_time_generation>0.359</min_time_generation>
 		<max_time_generation>0.359</max_time_generation>
 		<entry_nb_visits>2</entry_nb_visits>
@@ -75,7 +75,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml
index d830fa0a593a42cfd00697b0ddd91c5364364358..44e3bd5eeb5cd01d1e6104dab2ece36e9edbfdba 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml
@@ -78,7 +78,7 @@
 		<nb_visits>3</nb_visits>
 		<nb_hits>3</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 		<min_time_generation>0.359</min_time_generation>
 		<max_time_generation>0.359</max_time_generation>
 		<entry_nb_visits>2</entry_nb_visits>
@@ -96,7 +96,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_month.xml
index 5c3ddd11479f1791eb17c89832fb20e7390d38a6..ec18e38c6661e807c02c42c004708599dfff9b60 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_month.xml
@@ -387,7 +387,7 @@
 		<nb_visits>4</nb_visits>
 		<nb_hits>4</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>4</nb_hits_with_time_generation>
 		<min_time_generation>0.359</min_time_generation>
 		<max_time_generation>0.359</max_time_generation>
 		<entry_nb_visits>3</entry_nb_visits>
@@ -405,7 +405,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>2</entry_nb_visits>
@@ -423,7 +423,7 @@
 						<nb_visits>2</nb_visits>
 						<nb_hits>2</nb_hits>
 						<sum_time_spent>0</sum_time_spent>
-						<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+						<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 						<min_time_generation>0.359</min_time_generation>
 						<max_time_generation>0.359</max_time_generation>
 						<entry_nb_visits>2</entry_nb_visits>
@@ -441,7 +441,7 @@
 								<nb_visits>2</nb_visits>
 								<nb_hits>2</nb_hits>
 								<sum_time_spent>0</sum_time_spent>
-								<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+								<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 								<min_time_generation>0.359</min_time_generation>
 								<max_time_generation>0.359</max_time_generation>
 								<entry_nb_visits>2</entry_nb_visits>
@@ -459,7 +459,7 @@
 										<nb_visits>2</nb_visits>
 										<nb_hits>2</nb_hits>
 										<sum_time_spent>0</sum_time_spent>
-										<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+										<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 										<min_time_generation>0.359</min_time_generation>
 										<max_time_generation>0.359</max_time_generation>
 										<entry_nb_visits>2</entry_nb_visits>
@@ -487,7 +487,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
@@ -505,7 +505,7 @@
 						<nb_visits>2</nb_visits>
 						<nb_hits>2</nb_hits>
 						<sum_time_spent>0</sum_time_spent>
-						<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+						<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 						<min_time_generation>0.359</min_time_generation>
 						<max_time_generation>0.359</max_time_generation>
 						<entry_nb_visits>1</entry_nb_visits>
@@ -929,7 +929,7 @@
 		<nb_visits>1</nb_visits>
 		<nb_hits>2</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 		<min_time_generation>0.109</min_time_generation>
 		<max_time_generation>0.109</max_time_generation>
 		<entry_nb_visits>1</entry_nb_visits>
@@ -947,7 +947,7 @@
 				<nb_visits>1</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.109</min_time_generation>
 				<max_time_generation>0.109</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml
index d89a8b5a90f405b6538a0cc23ef1fd47c51cca99..c649d1bb3bf6989488041a67b81a1943c535586b 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml
@@ -651,7 +651,7 @@
 		<nb_visits>4</nb_visits>
 		<nb_hits>4</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>4</nb_hits_with_time_generation>
 		<min_time_generation>0.359</min_time_generation>
 		<max_time_generation>0.359</max_time_generation>
 		<entry_nb_visits>3</entry_nb_visits>
@@ -669,7 +669,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>2</entry_nb_visits>
@@ -687,7 +687,7 @@
 						<nb_visits>2</nb_visits>
 						<nb_hits>2</nb_hits>
 						<sum_time_spent>0</sum_time_spent>
-						<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+						<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 						<min_time_generation>0.359</min_time_generation>
 						<max_time_generation>0.359</max_time_generation>
 						<entry_nb_visits>2</entry_nb_visits>
@@ -705,7 +705,7 @@
 								<nb_visits>2</nb_visits>
 								<nb_hits>2</nb_hits>
 								<sum_time_spent>0</sum_time_spent>
-								<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+								<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 								<min_time_generation>0.359</min_time_generation>
 								<max_time_generation>0.359</max_time_generation>
 								<entry_nb_visits>2</entry_nb_visits>
@@ -723,7 +723,7 @@
 										<nb_visits>2</nb_visits>
 										<nb_hits>2</nb_hits>
 										<sum_time_spent>0</sum_time_spent>
-										<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+										<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 										<min_time_generation>0.359</min_time_generation>
 										<max_time_generation>0.359</max_time_generation>
 										<entry_nb_visits>2</entry_nb_visits>
@@ -751,7 +751,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
@@ -769,7 +769,7 @@
 						<nb_visits>2</nb_visits>
 						<nb_hits>2</nb_hits>
 						<sum_time_spent>0</sum_time_spent>
-						<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+						<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 						<min_time_generation>0.359</min_time_generation>
 						<max_time_generation>0.359</max_time_generation>
 						<entry_nb_visits>1</entry_nb_visits>
@@ -1270,7 +1270,7 @@
 		<nb_visits>1</nb_visits>
 		<nb_hits>2</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 		<min_time_generation>0.109</min_time_generation>
 		<max_time_generation>0.109</max_time_generation>
 		<entry_nb_visits>1</entry_nb_visits>
@@ -1288,7 +1288,7 @@
 				<nb_visits>1</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.109</min_time_generation>
 				<max_time_generation>0.109</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_month.xml
index 4e75cfd774cf6a15a380e8d637ee5959a4a2e3a7..e6e2c17213c6eea5192c379b3502bdf83366765f 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_month.xml
@@ -42,7 +42,7 @@
 		<nb_visits>3</nb_visits>
 		<nb_hits>3</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 		<min_time_generation>0.359</min_time_generation>
 		<max_time_generation>0.359</max_time_generation>
 		<entry_nb_visits>2</entry_nb_visits>
@@ -60,7 +60,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml
index 0cdf2e7047adfbf4cd1084f53393a6c5ea13ba56..86e26ebf311f381f99845bc9c40456442adf443c 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml
@@ -63,7 +63,7 @@
 		<nb_visits>3</nb_visits>
 		<nb_hits>3</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 		<min_time_generation>0.359</min_time_generation>
 		<max_time_generation>0.359</max_time_generation>
 		<entry_nb_visits>2</entry_nb_visits>
@@ -81,7 +81,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_month.xml
index 0b291ef113c1e0010f9b229950a001d88e47dbc6..bf371f7283b330245cbca871166fa6bb82024a3e 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_month.xml
@@ -387,7 +387,7 @@
 		<nb_visits>4</nb_visits>
 		<nb_hits>4</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>4</nb_hits_with_time_generation>
 		<min_time_generation>0.359</min_time_generation>
 		<max_time_generation>0.359</max_time_generation>
 		<entry_nb_visits>3</entry_nb_visits>
@@ -405,7 +405,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>2</entry_nb_visits>
@@ -423,7 +423,7 @@
 						<nb_visits>2</nb_visits>
 						<nb_hits>2</nb_hits>
 						<sum_time_spent>0</sum_time_spent>
-						<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+						<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 						<min_time_generation>0.359</min_time_generation>
 						<max_time_generation>0.359</max_time_generation>
 						<entry_nb_visits>2</entry_nb_visits>
@@ -441,7 +441,7 @@
 								<nb_visits>2</nb_visits>
 								<nb_hits>2</nb_hits>
 								<sum_time_spent>0</sum_time_spent>
-								<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+								<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 								<min_time_generation>0.359</min_time_generation>
 								<max_time_generation>0.359</max_time_generation>
 								<entry_nb_visits>2</entry_nb_visits>
@@ -459,7 +459,7 @@
 										<nb_visits>2</nb_visits>
 										<nb_hits>2</nb_hits>
 										<sum_time_spent>0</sum_time_spent>
-										<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+										<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 										<min_time_generation>0.359</min_time_generation>
 										<max_time_generation>0.359</max_time_generation>
 										<entry_nb_visits>2</entry_nb_visits>
@@ -487,7 +487,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
@@ -505,7 +505,7 @@
 						<nb_visits>2</nb_visits>
 						<nb_hits>2</nb_hits>
 						<sum_time_spent>0</sum_time_spent>
-						<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+						<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 						<min_time_generation>0.359</min_time_generation>
 						<max_time_generation>0.359</max_time_generation>
 						<entry_nb_visits>1</entry_nb_visits>
@@ -923,7 +923,7 @@
 		<nb_visits>1</nb_visits>
 		<nb_hits>2</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 		<min_time_generation>0.109</min_time_generation>
 		<max_time_generation>0.109</max_time_generation>
 		<entry_nb_visits>1</entry_nb_visits>
@@ -941,7 +941,7 @@
 				<nb_visits>1</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.109</min_time_generation>
 				<max_time_generation>0.109</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml
index 484a6525e75165771b3bfe8a3e405110760aebee..15c03062076553b5a9d40eac4168e701ba2d0f10 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml
@@ -651,7 +651,7 @@
 		<nb_visits>4</nb_visits>
 		<nb_hits>4</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>4</nb_hits_with_time_generation>
 		<min_time_generation>0.359</min_time_generation>
 		<max_time_generation>0.359</max_time_generation>
 		<entry_nb_visits>3</entry_nb_visits>
@@ -669,7 +669,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>2</entry_nb_visits>
@@ -687,7 +687,7 @@
 						<nb_visits>2</nb_visits>
 						<nb_hits>2</nb_hits>
 						<sum_time_spent>0</sum_time_spent>
-						<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+						<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 						<min_time_generation>0.359</min_time_generation>
 						<max_time_generation>0.359</max_time_generation>
 						<entry_nb_visits>2</entry_nb_visits>
@@ -705,7 +705,7 @@
 								<nb_visits>2</nb_visits>
 								<nb_hits>2</nb_hits>
 								<sum_time_spent>0</sum_time_spent>
-								<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+								<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 								<min_time_generation>0.359</min_time_generation>
 								<max_time_generation>0.359</max_time_generation>
 								<entry_nb_visits>2</entry_nb_visits>
@@ -723,7 +723,7 @@
 										<nb_visits>2</nb_visits>
 										<nb_hits>2</nb_hits>
 										<sum_time_spent>0</sum_time_spent>
-										<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+										<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 										<min_time_generation>0.359</min_time_generation>
 										<max_time_generation>0.359</max_time_generation>
 										<entry_nb_visits>2</entry_nb_visits>
@@ -751,7 +751,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
@@ -769,7 +769,7 @@
 						<nb_visits>2</nb_visits>
 						<nb_hits>2</nb_hits>
 						<sum_time_spent>0</sum_time_spent>
-						<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+						<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 						<min_time_generation>0.359</min_time_generation>
 						<max_time_generation>0.359</max_time_generation>
 						<entry_nb_visits>1</entry_nb_visits>
@@ -1258,7 +1258,7 @@
 		<nb_visits>1</nb_visits>
 		<nb_hits>2</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 		<min_time_generation>0.109</min_time_generation>
 		<max_time_generation>0.109</max_time_generation>
 		<entry_nb_visits>1</entry_nb_visits>
@@ -1276,7 +1276,7 @@
 				<nb_visits>1</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.109</min_time_generation>
 				<max_time_generation>0.109</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_month.xml
index 020db101c3dca1c8e01be5225979c772656c5a63..a15246afad961d79fd1b3ba11b35e80d30a33220 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_month.xml
@@ -5,14 +5,14 @@
 		<nb_visits>26</nb_visits>
 		<nb_hits>27</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>4</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>6</nb_hits_with_time_generation>
 		<min_time_generation>0.001</min_time_generation>
 		<max_time_generation>0.359</max_time_generation>
 		<sum_daily_nb_uniq_visitors>25</sum_daily_nb_uniq_visitors>
 		<avg_time_on_page>0</avg_time_on_page>
 		<bounce_rate>0%</bounce_rate>
 		<exit_rate>0%</exit_rate>
-		<avg_time_generation>0.118</avg_time_generation>
+		<avg_time_generation>0.156</avg_time_generation>
 	</row>
 	<row>
 		<label>301</label>
@@ -71,7 +71,7 @@
 		<nb_visits>3</nb_visits>
 		<nb_hits>3</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 		<min_time_generation>0.359</min_time_generation>
 		<max_time_generation>0.359</max_time_generation>
 		<entry_nb_visits>2</entry_nb_visits>
@@ -89,7 +89,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_range.xml
index d9823b9bc3b9967beda0ae9aee8de5f45e40730f..4eaa547bf98b39c35133dc56f55b13c5ed62613b 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_range.xml
@@ -5,14 +5,14 @@
 		<nb_visits>27</nb_visits>
 		<nb_hits>37</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>14</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>16</nb_hits_with_time_generation>
 		<min_time_generation>0.001</min_time_generation>
 		<max_time_generation>1.324</max_time_generation>
 		<sum_daily_nb_uniq_visitors>26</sum_daily_nb_uniq_visitors>
 		<avg_time_on_page>0</avg_time_on_page>
 		<bounce_rate>0%</bounce_rate>
 		<exit_rate>0%</exit_rate>
-		<avg_time_generation>0.31</avg_time_generation>
+		<avg_time_generation>0.3</avg_time_generation>
 	</row>
 	<row>
 		<label> Liberate Web Analytics - Analytics - Piwik</label>
@@ -92,7 +92,7 @@
 		<nb_visits>3</nb_visits>
 		<nb_hits>3</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 		<min_time_generation>0.359</min_time_generation>
 		<max_time_generation>0.359</max_time_generation>
 		<entry_nb_visits>2</entry_nb_visits>
@@ -110,7 +110,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_month.xml
index 00aa9c93a52dbd1abc8399a48a81cd77c66a4b14..6ce4ef4d623bc6cb190f5cdd94eec9375be94e59 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_month.xml
@@ -387,7 +387,7 @@
 		<nb_visits>4</nb_visits>
 		<nb_hits>4</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>4</nb_hits_with_time_generation>
 		<min_time_generation>0.359</min_time_generation>
 		<max_time_generation>0.359</max_time_generation>
 		<entry_nb_visits>3</entry_nb_visits>
@@ -405,7 +405,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>2</entry_nb_visits>
@@ -423,7 +423,7 @@
 						<nb_visits>2</nb_visits>
 						<nb_hits>2</nb_hits>
 						<sum_time_spent>0</sum_time_spent>
-						<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+						<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 						<min_time_generation>0.359</min_time_generation>
 						<max_time_generation>0.359</max_time_generation>
 						<entry_nb_visits>2</entry_nb_visits>
@@ -441,7 +441,7 @@
 								<nb_visits>2</nb_visits>
 								<nb_hits>2</nb_hits>
 								<sum_time_spent>0</sum_time_spent>
-								<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+								<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 								<min_time_generation>0.359</min_time_generation>
 								<max_time_generation>0.359</max_time_generation>
 								<entry_nb_visits>2</entry_nb_visits>
@@ -459,7 +459,7 @@
 										<nb_visits>2</nb_visits>
 										<nb_hits>2</nb_hits>
 										<sum_time_spent>0</sum_time_spent>
-										<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+										<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 										<min_time_generation>0.359</min_time_generation>
 										<max_time_generation>0.359</max_time_generation>
 										<entry_nb_visits>2</entry_nb_visits>
@@ -487,7 +487,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
@@ -505,7 +505,7 @@
 						<nb_visits>2</nb_visits>
 						<nb_hits>2</nb_hits>
 						<sum_time_spent>0</sum_time_spent>
-						<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+						<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 						<min_time_generation>0.359</min_time_generation>
 						<max_time_generation>0.359</max_time_generation>
 						<entry_nb_visits>1</entry_nb_visits>
@@ -959,7 +959,7 @@
 		<nb_visits>1</nb_visits>
 		<nb_hits>2</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 		<min_time_generation>0.109</min_time_generation>
 		<max_time_generation>0.109</max_time_generation>
 		<entry_nb_visits>1</entry_nb_visits>
@@ -977,7 +977,7 @@
 				<nb_visits>1</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.109</min_time_generation>
 				<max_time_generation>0.109</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_range.xml
index 091e1215c867b2641adbc1e76cf7619b3f6dbbae..083021160df8106354d1d3ad87a67d85ac39c441 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_range.xml
@@ -651,7 +651,7 @@
 		<nb_visits>4</nb_visits>
 		<nb_hits>4</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>4</nb_hits_with_time_generation>
 		<min_time_generation>0.359</min_time_generation>
 		<max_time_generation>0.359</max_time_generation>
 		<entry_nb_visits>3</entry_nb_visits>
@@ -669,7 +669,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>2</entry_nb_visits>
@@ -687,7 +687,7 @@
 						<nb_visits>2</nb_visits>
 						<nb_hits>2</nb_hits>
 						<sum_time_spent>0</sum_time_spent>
-						<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+						<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 						<min_time_generation>0.359</min_time_generation>
 						<max_time_generation>0.359</max_time_generation>
 						<entry_nb_visits>2</entry_nb_visits>
@@ -705,7 +705,7 @@
 								<nb_visits>2</nb_visits>
 								<nb_hits>2</nb_hits>
 								<sum_time_spent>0</sum_time_spent>
-								<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+								<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 								<min_time_generation>0.359</min_time_generation>
 								<max_time_generation>0.359</max_time_generation>
 								<entry_nb_visits>2</entry_nb_visits>
@@ -723,7 +723,7 @@
 										<nb_visits>2</nb_visits>
 										<nb_hits>2</nb_hits>
 										<sum_time_spent>0</sum_time_spent>
-										<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+										<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 										<min_time_generation>0.359</min_time_generation>
 										<max_time_generation>0.359</max_time_generation>
 										<entry_nb_visits>2</entry_nb_visits>
@@ -751,7 +751,7 @@
 				<nb_visits>2</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.359</min_time_generation>
 				<max_time_generation>0.359</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
@@ -769,7 +769,7 @@
 						<nb_visits>2</nb_visits>
 						<nb_hits>2</nb_hits>
 						<sum_time_spent>0</sum_time_spent>
-						<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+						<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 						<min_time_generation>0.359</min_time_generation>
 						<max_time_generation>0.359</max_time_generation>
 						<entry_nb_visits>1</entry_nb_visits>
@@ -1348,7 +1348,7 @@
 		<nb_visits>1</nb_visits>
 		<nb_hits>2</nb_hits>
 		<sum_time_spent>0</sum_time_spent>
-		<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+		<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 		<min_time_generation>0.109</min_time_generation>
 		<max_time_generation>0.109</max_time_generation>
 		<entry_nb_visits>1</entry_nb_visits>
@@ -1366,7 +1366,7 @@
 				<nb_visits>1</nb_visits>
 				<nb_hits>2</nb_hits>
 				<sum_time_spent>0</sum_time_spent>
-				<nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+				<nb_hits_with_time_generation>2</nb_hits_with_time_generation>
 				<min_time_generation>0.109</min_time_generation>
 				<max_time_generation>0.109</max_time_generation>
 				<entry_nb_visits>1</entry_nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_month.xml
index 4e24f3a35551547026ead7903b4d3a8a49ede27b..13b24ecfac4898860e466465dd61bb42a9e344bb 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_month.xml
@@ -8,5 +8,5 @@
 	<nb_uniq_outlinks>0</nb_uniq_outlinks>
 	<nb_searches>0</nb_searches>
 	<nb_keywords>0</nb_keywords>
-	<avg_time_generation>0.166</avg_time_generation>
+	<avg_time_generation>0.206</avg_time_generation>
 </result>
\ No newline at end of file
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 9545726b4911e58667c6595f1a8ad4b8dda4e2ef..4a6377547d38bc4a58f0fa6153bb567e5662ef13 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__CustomVariables.getCustomVariables_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__CustomVariables.getCustomVariables_month.xml
@@ -6,9 +6,9 @@
 		<subtable>
 			<row>
 				<label>200</label>
-				<nb_visits>31</nb_visits>
+				<nb_visits>32</nb_visits>
 				<nb_actions>34</nb_actions>
-				<sum_daily_nb_uniq_visitors>30</sum_daily_nb_uniq_visitors>
+				<sum_daily_nb_uniq_visitors>32</sum_daily_nb_uniq_visitors>
 			</row>
 			<row>
 				<label>301</label>
@@ -20,7 +20,7 @@
 				<label>404</label>
 				<nb_visits>3</nb_visits>
 				<nb_actions>3</nb_actions>
-				<sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
+				<sum_daily_nb_uniq_visitors>3</sum_daily_nb_uniq_visitors>
 			</row>
 			<row>
 				<label>302</label>
@@ -133,10 +133,10 @@
 	</row>
 	<row>
 		<label>User Name</label>
-		<nb_visits>3</nb_visits>
-		<nb_actions>5</nb_actions>
+		<nb_visits>4</nb_visits>
+		<nb_actions>7</nb_actions>
 		<max_actions>3</max_actions>
-		<sum_visit_length>3</sum_visit_length>
+		<sum_visit_length>4</sum_visit_length>
 		<bounce_count>2</bounce_count>
 		<goals>
 			<row idgoal='1'>
@@ -147,8 +147,8 @@
 		</goals>
 		<nb_conversions>2</nb_conversions>
 		<revenue>10</revenue>
-		<sum_daily_nb_uniq_visitors>3</sum_daily_nb_uniq_visitors>
-		<sum_daily_nb_users>1</sum_daily_nb_users>
+		<sum_daily_nb_uniq_visitors>4</sum_daily_nb_uniq_visitors>
+		<sum_daily_nb_users>2</sum_daily_nb_users>
 		<subtable>
 			<row>
 				<label>user1</label>
@@ -169,6 +169,17 @@
 				<sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
 				<sum_daily_nb_users>1</sum_daily_nb_users>
 			</row>
+			<row>
+				<label>-</label>
+				<nb_visits>1</nb_visits>
+				<nb_actions>2</nb_actions>
+				<max_actions>2</max_actions>
+				<sum_visit_length>1</sum_visit_length>
+				<bounce_count>0</bounce_count>
+				<nb_visits_converted>1</nb_visits_converted>
+				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+				<sum_daily_nb_users>1</sum_daily_nb_users>
+			</row>
 			<row>
 				<label>user2</label>
 				<nb_visits>1</nb_visits>
@@ -192,7 +203,7 @@
 	</row>
 	<row>
 		<label>Generation Time</label>
-		<nb_actions>3</nb_actions>
+		<nb_actions>4</nb_actions>
 		<subtable>
 			<row>
 				<label>359</label>
@@ -200,6 +211,12 @@
 				<nb_actions>2</nb_actions>
 				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
 			</row>
+			<row>
+				<label>0</label>
+				<nb_visits>1</nb_visits>
+				<nb_actions>1</nb_actions>
+				<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+			</row>
 			<row>
 				<label>109</label>
 				<nb_visits>1</nb_visits>
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml
index e86830b4d17acc9f70206efd2c095590dec04df1..544cac8cbb217f11529a5e525b311b9963da4722 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml
@@ -2108,14 +2108,15 @@
 				<pageId>71</pageId>
 				<customVariables>
 					<row>
-						<customVariablePageName1>HTTP-code</customVariablePageName1>
-						<customVariablePageValue1>200</customVariablePageValue1>
+						<customVariablePageName1>Generation Time</customVariablePageName1>
+						<customVariablePageValue1>359</customVariablePageValue1>
 					</row>
 					<row>
-						<customVariablePageName2>Generation Time</customVariablePageName2>
-						<customVariablePageValue2>359</customVariablePageValue2>
+						<customVariablePageName2>HTTP-code</customVariablePageName2>
+						<customVariablePageValue2>200</customVariablePageValue2>
 					</row>
 				</customVariables>
+				<generationTime>0.36s</generationTime>
 				<icon />
 				
 			</row>
@@ -2259,14 +2260,15 @@
 				<pageId>68</pageId>
 				<customVariables>
 					<row>
-						<customVariablePageName1>HTTP-code</customVariablePageName1>
-						<customVariablePageValue1>200</customVariablePageValue1>
+						<customVariablePageName1>Generation Time</customVariablePageName1>
+						<customVariablePageValue1>109</customVariablePageValue1>
 					</row>
 					<row>
-						<customVariablePageName2>Generation Time</customVariablePageName2>
-						<customVariablePageValue2>109</customVariablePageValue2>
+						<customVariablePageName2>HTTP-code</customVariablePageName2>
+						<customVariablePageValue2>200</customVariablePageValue2>
 					</row>
 				</customVariables>
+				<generationTime>0.11s</generationTime>
 				<icon />
 				
 			</row>
@@ -2469,14 +2471,15 @@
 				<pageId>70</pageId>
 				<customVariables>
 					<row>
-						<customVariablePageName1>HTTP-code</customVariablePageName1>
-						<customVariablePageValue1>404</customVariablePageValue1>
+						<customVariablePageName1>Generation Time</customVariablePageName1>
+						<customVariablePageValue1>359</customVariablePageValue1>
 					</row>
 					<row>
-						<customVariablePageName2>Generation Time</customVariablePageName2>
-						<customVariablePageValue2>359</customVariablePageValue2>
+						<customVariablePageName2>HTTP-code</customVariablePageName2>
+						<customVariablePageValue2>404</customVariablePageValue2>
 					</row>
 				</customVariables>
+				<generationTime>0.36s</generationTime>
 				<timeSpent>0</timeSpent>
 				<timeSpentPretty>0s</timeSpentPretty>
 				<icon />
@@ -2573,6 +2576,10 @@
 		<providerName>Unknown</providerName>
 		<providerUrl />
 		<customVariables>
+			<row>
+				<customVariableName1>User Name</customVariableName1>
+				<customVariableValue1>-</customVariableValue1>
+			</row>
 		</customVariables>
 		<resolution>unknown</resolution>
 		<plugins />
@@ -2609,8 +2616,12 @@
 				<pageId>69</pageId>
 				<customVariables>
 					<row>
-						<customVariablePageName1>HTTP-code</customVariablePageName1>
-						<customVariablePageValue1>301</customVariablePageValue1>
+						<customVariablePageName1>Generation Time</customVariablePageName1>
+						<customVariablePageValue1>0</customVariablePageValue1>
+					</row>
+					<row>
+						<customVariablePageName2>HTTP-code</customVariablePageName2>
+						<customVariablePageValue2>301</customVariablePageValue2>
 					</row>
 				</customVariables>
 				<icon />