We have some dimensions we are attempting to filter by which include a number in the name, namely pagePathLevel1 and pagePathLevel2.
in gapi.class.php:199 (the processFilters method) we use a regex to find:
Group 1: The start of the string, or a boolean combinator followed by 0 or more spaces
Group 2: one or more letters
Group 3: 0 or more spaces, followed by a valid operator
and prepend a 'ga:' to the second group. In our case it is not happening because the numeric portion of the dimension prevents it from matching the regex.
I believe this would be resolved by changing the appropriate regex to:
Although I believe dimensions cannot START with numbers, so it may need to be more restrictive, like maybe:
$filter = preg_replace('/(&&\s*|\|\|\s*|^)([a-z]+[a-z0-9]*)(\s*' . $valid_operators . ')/i','$1ga:$2$3',$filter);
In the meantime I am getting around this by manually including the prefix for these dimensions.
Hi all,
We have some dimensions we are attempting to filter by which include a number in the name, namely pagePathLevel1 and pagePathLevel2. in
gapi.class.php:199
(the processFilters method) we use a regex to find: Group 1: The start of the string, or a boolean combinator followed by 0 or more spaces Group 2: one or more letters Group 3: 0 or more spaces, followed by a valid operator and prepend a 'ga:' to the second group. In our case it is not happening because the numeric portion of the dimension prevents it from matching the regex.I believe this would be resolved by changing the appropriate regex to:
$filter = preg_replace('/(&&\s*|\|\|\s*|^)([a-z0-9]+)(\s*' . $valid_operators . ')/i','$1ga:$2$3',$filter);
Although I believe dimensions cannot START with numbers, so it may need to be more restrictive, like maybe:
$filter = preg_replace('/(&&\s*|\|\|\s*|^)([a-z]+[a-z0-9]*)(\s*' . $valid_operators . ')/i','$1ga:$2$3',$filter);
In the meantime I am getting around this by manually including the prefix for these dimensions.