Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show unique visitors on visitor map as default if available #13517

Merged
merged 3 commits into from Dec 2, 2018

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Oct 1, 2018

fixes #13456

@sgiehl sgiehl added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Oct 1, 2018
@mattab mattab added this to the 3.7.0 milestone Oct 9, 2018
data[metric] = totalMetricValue;
$('.map-stats').html(
'<strong>' + formatValueForTooltips(data, metric, false) + '</strong>' +
(id != 'world' ? (' (' + formatPercentage(totalMetricValue / self.config.visitsSummary[metric]) + ')') : '')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the percentage calculation be the other way around? ie, self.config.visitsSummary[metric] / totalMetricValue? And it's expected that for the first and last case in the if statement (id.length == 3 and else), that it will just be 100%, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Should be correct that way. Maybe the names of the variables are a bit misleading. totalMetricValue holds the metric value for the selected/shown region (e.g. world,continent,country), and that is compared to the overall total. So self.config.visitsSummary[metric] is 100%. For the worldmap that would be always 100%, so it's now shown at all...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, 👍

@diosmosis diosmosis merged commit 79a1bd2 into 3.x-dev Dec 2, 2018
@diosmosis diosmosis deleted the visitormapmetric branch December 2, 2018 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Locations users country map should use Unique visitors by default
3 participants