AdSense connect graphics are loaded regardless of CTA dismissal
See original GitHub issueBug Description
The AdSense connect CTA shown at the bottom of the dashboard lazy loads the 3 graphics shown for its slides. Currently, it can be observed that these graphics are being requested by the browser even when the CTA is dismissed and shouldn’t be rendered at all.
This seems to be due to a timing issue where it is briefly rendered (triggering these requests) before it is removed again.
Steps to reproduce
- Load the dashboard with the AdSense connect CTA dismissed
- Observe requests in the network console for chunks related to the adsense graphics
Screenshots
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- AdSense CTA graphics should only be loaded on the dashboard when the
adsense-connect-cta
is not dismissed
Implementation Brief
- In
assets/js/modules/adsense/components/dashboard/AdSenseConnectCTAWidget.js
:- Instead of rendering
<WidgetNull />
conditionally, render<Widget />
containing<AdSenseConnectCTA />
first if bothadSenseModuleConnected
andhasDismissedWidget
are explicitlyfalse
(they return anundefined
value until resolved, which is falsey. Thus, we need to check if they’re=== false
explicitly). - Afterwards, return
<WidgetNull />
unconditionally if the prior return statements are not executed.
- Instead of rendering
Test Coverage
- No tests need to be added/updated.
QA Brief
- Load the dashboard with the AdSense connect CTA dismissed
- Observe requests in the network console for chunks related to the AdSense graphics
0.js
,1.js
,2.js
chunks (files) should not be loaded
Changelog entry
- Fix bug that caused AdSense graphics in CTA banner to be loaded when not needed.
Issue Analytics
- State:
- Created a year ago
- Comments:7
Top Results From Across the Web
What to do when your site is not ready to show ads
There are several reasons why your site may not be ready to show ads. Discover what you need to fix and how to...
Read more >Site Kit by Google – Analytics, Search Console, AdSense ...
Site Kit is the one-stop solution to deploy, manage, and get insights from critical Google tools to make the site successful on the...
Read more >How to Make Money Advertising - Google AdSense
If you want to make money with Google, AdSense is a great place to start. Check out these 4 tips to potentially maximize...
Read more >Lazy loading - Publisher Tag - Google Developers
Defer the requesting and rendering of ads.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mohitwp yes, I was also unable to recreate the issue, so its difficult to know if the ticket fixes it.
@aaemnnosttv is it possible that this can only be seen on a local setup? if not, would you be able to create a screencast?
QA Update ✅
Thank you @sashadoes.
Latest -
Dev :-
When CTA is not dismissed -