-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Count of unique visitors by Referer plugin don't agree with count of that by Visits plugin.
For example: On one site "Visits Over Time" report has a 28339 visitors and 48697 visits. But in Referrers->Overview tab in "Details by Referrer Type" report we can see that total count of Visits is 48697 (36499 by direct, 6295 by websites, 3099 by search engines and 2804 by campaigns). But total count of Unique visitors is 33684 (22684 by direct entry, 5488 by websites, 11332 by search engines and 7293 as campaigns). That has a difference from Visits plugin by 5345 visitors.
Looked for this bug I finded problem in Referer plugins method Referers::archiveDayAggregateVisits. It uses ArchiveProcessing_Day::queryVisitsByDimension method to find and aggregate visits and visitors. But if visitor has a several visits in one day and with different types of referrers, it calculates him more than one time.
I wrote a patch for fix this behavior. When I tested it, as addition to fix the problem turn out that the method Referers::archiveDayAggregateVisits with my patch works more fast than original version about two times on my laptop (~1.4 sec opposite ~3.1 sec of original execution time).