Use bounce_rate metric directly in visitor map instead of… calculating using bounce_count (which has to manually requested), and correctly format bounce_rate values in the legend. Also, use avg_time_on_site metric directly, and format in JS properly.
Also includes a bug fix in Request.php: if
format_metrics=0 is supplied, it will be overwritten to
if (empty($request['format_metrics'])) is used, instead of
To use unformatted (but computed) processed metrics in the visitor map, the code now formats the code itself in JS, at least for bounce_rate + avg_time_on_site. Bounce rate must be multiplied by 100. Average time on site just has to convert to a time string when being displayed.
Best to review commit by commit, paying attention to commit messages.
Turned into a bigger PR than I anticipated, @mattab please review. BC should be maintained.
@diosmosis could you add a UI test showing the bounce rate legend on the map?
Looks good to me to merge after two UI tests added (one for bounce rate, one for average time on site) :+1: