-
Notifications
You must be signed in to change notification settings - Fork 296
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
Data validity for audience tiles when connected to Analytics #8763
Comments
Hi @kelvinballoo, thanks for raising this issue. The "cities" metric is clearly incorrect and it's entirely reasonable to question the validity of the metrics. To your question about calculating metrics, the only metric we're actually calculating (as opposed to simply rounding) is in fact the "cities" one - and in fact the problem observed is because we're not performing the expected calculation (we're currently not dividing the values for the "cities" metric by the total number of visitors). The metrics that are used in the reports are defined in the design doc. As you'll see, "visits per visitor" is directly retrieved via the You may notice some discrepancies between data in Site Kit and reports/explorations in Analytics. The difference in the headline "visitors" figure ("users" in Analytics) is due to Site Kit using the If you notice other differences it's quite possible they can be explained by the factors discussed in this comment: #7214 (comment). An additional aspect to consider on the topic of data consistency is how we present the same metrics in multiple places within Site Kit itself. It's worth noting that all of the metrics for an audience are viewable elsewhere in Site Kit, so when viewing the "all visitors" audience, we can cross reference other widgets as a sanity check for the figures. To illustrate the point, here's a map of the metrics on the Audience Tile to the same metrics on Key Metric tiles and the All Traffic widget: As you can see most of them match up. The "cities" values are totally off, and there are a couple of additional differences which are due to rounding. The net of this is that we need to fix the "cities" values, and we should provide consistent rounding where it makes sense to - specifically, I think the "pages per visit" metric should be rounded to two decimal places on the Audience Tile to match the KM tile. The "total pageviews" figure can remain rounded as it is, in order to match the formatting of the "visitors" figure, it would look a bit odd otherwise. I have therefore added AC to this issue to address these specific points. Hopefully that clarifies things and provides some useful background / context. It's undoubtedly a complex topic. Please let me know if there's anything that could use further clarification or discussion! :) |
Hey @ankitrox, thanks for drafting this IB. A couple of points: Considering that Line 42 in 721401e
I'd suggest it would be slightly cleaner to take a similar approach to site-kit-wp/assets/js/components/KeyMetrics/MetricTileNumeric.js Lines 31 to 48 in 721401e
Also, site-kit-wp/assets/js/modules/analytics-4/components/widgets/PagesPerVisitWidget.js Lines 103 to 106 in 721401e
|
Hi @techanvil , Thanks for reviewing the IB and adding your valuable feedback. I completely agree with your approach and it is the simpler one. I have updated IB as per the suggestion. Assigning this to you for re-review. Thanks |
Thanks @ankitrox! The IB LGTM. ✅ |
QA Update
|
FYI @techanvil, @mohitwp above found a bug where data was inconsistent on the "All visitors" tile. I found a clear way to repeat this:
The reason this happens is that, the steps above load the tiles in a different order to their default order, and the order in which the audiences are queries and returned in the GA reports. Previously we relied upon the order of the returned rows when choosing which data to pass to the tiles. I fixed this in this PR by filtering rows by their dimensionValue header rather than relying on their order. As this is new work I will put it into CR. |
Hi @mohitwp and @benbowler. Thanks for both spotting this and finding a fix; however - it's actually a known issue, #8921, and that issue has an IB and a draft PR. Actually, I do prefer the PR for that issue - it's very similar but it also looks up the rows by the As such, and with a view to ensuring this issue doesn't creep over the estimate, I'd say let's keep this issue to what's defined and address the above defect via #8921. |
QA Update ✅
Note : Data is still not showing correct in Audience tiles as mentioned above. As per @techanvil this issue will be fix by #8921. Last 28 days Last 7 Days Last 14 days Last 90 Days |
Bug Description
I don't think there is a task but we should absolutely look into data validity for those data that we surface on audience tiles for audience segmentation.
If you look at the screenshots below, you will notice that for cities, we have percentages like 119400% which is very strange.
Moreover, we'd have to list down the logic from where or how we are computing certain data from analytics.
E.g. how are we getting the visits per visitor? On analytics, I don't see that number and chances are we are computing it?
Note: This ticket stemmed from the comment here: #8138 (comment)
Steps to reproduce
Screenshots
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
In
assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTile/AudienceTileMetric.js
metricValueFormat
, this would be the object which should be passed tonumFmt
function asoptions
.In
assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTile/index.js
AudienceTileMetric
component, passmetricValueFormat
prop as:In
assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTile/AudienceTileCitiesMetric.js
topCities?.metricValues[ index ]?.value
bytopCities.total
to get the correct percent value.Test coverage
AudienceTile
to display correct metric values.QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: