Closed wpdarren closed 8 months ago
Related issues
@wpdarren I wasn't able to reproduce this on a site that appears to have no data, so you may need to help provide details as to how to reproduce this.
@wpdarren Reassigning this to you, can you please see if this is still occurring? TY!
@aaemnnosttv There's nothing more to share about how to recreate this other than that I set up AdSense, and within 90 days, there is a small amount of money, now $0.05. No issue occurs on 7 and 14 days, but on 28 days on the Earnings
and Page CTR
tabs it displays as per the screenshot. I also noticed that in 90 days, the same happened on Page CTR
I tested this again on the latest release, and the issue still occurs.
It's possible that it's an edge case.
Can I give you access to the Search Console AdSense account to test it yourself?
https://github.com/google/site-kit-wp/assets/73545194/bb8231c9-cbe6-4017-8ce1-7159919ebf89
Update: I tried various variations of AdSense reporting simulation using the tester plugin but wasn't able to reproduce this. I also looked into the related similar issues and verified that the fix there is applied in the AdSense chart. It would be helpful to take a look at a site where the error can be seen. @wpdarren (when you're back from the holiday break), could you share access details to the site internally? Thanks!
@wpdarren Reassigned to you to help with the site detail info, thanks!
@bethanylang, apologies. I should have updated this ticket with a comment. I have already provided @nfmohit with details for the site where this issue can be re-created on 2 January. I'll assign the ticket to Nahid.
Thank you for sharing access to the account, @wpdarren. I was able to reproduce the issue and I have been able to find the root cause.
For curious minds, here's what I have found so far. In order for the chart's V-axis to start at 0 (non-negative), the vAxis.viewWindow.min
and vAxis.viewWindow.max
values need to be defined. While we set vAxis.viewWindow.min
to 0
in the default configuration:
We only set vAxis.viewWindow.max
to a ceiling of 100
when we have a zero report:
However, in the case of this specific site, the previous range data is not zero, it actually has data:
Which is why, the vAxis.viewWindow.max
ceiling is set to undefined
, causing the V-axis to go negative.
Even though the previous range has some data, it doesn't show up in the chart:
I'll continue my investigation to find out why that is the case.
IB ✔️
@zutigrm could you please add the estimate please?
@eugene-manuilov Added, sorry about that.
Assigning @wpdarren as he has a site to test this behaviour on (and will know which site it is 😄).
https://github.com/google/site-kit-wp/assets/73545194/72be99b2-9522-4a19-a0f2-ea004b0fcc02
Bug Description
When AdSense is connected and the account and site has been approved. The AdSense
Performance over the last X days
displays minus figures in the y-axis section of the chart, when no earnings have been made in the period.What's unusual is that the issue only occurs on 28 days. The chart looks fine for 7, 14 days. I am unsure about 90 days because the site did generate a huge £0.01 within this period.
Please note: I have a site where you can see this in action without the tester plugin, if this helps.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
0
regardless of the amount of data it hasImplementation Brief
assets/js/modules/adsense/util/is-zero-report.js
:report
parameter, include newselectedStatsIndex
parameter (it is of type number)if ( +totals.cells[ selectedStatsIndex ]?.value === 0 )
assets/js/modules/adsense/components/module/ModuleOverviewWidget/Stats.js
:izZeroReport
function https://github.com/google/site-kit-wp/blob/ab9d76bebe8a3368eaf73b194edf941fd42f2ec5/assets/js/modules/adsense/components/module/ModuleOverviewWidget/Stats.js#L137-L138, to include second parameterselectedStats + 1
Test Coverage
assets/js/modules/adsense/util/is-zero-report.test.js
to take into the account second parameterQA Brief
Changelog entry