question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AdSense connect graphics are loaded regardless of CTA dismissal

See original GitHub issue

Bug 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

  1. Load the dashboard with the AdSense connect CTA dismissed
  2. Observe requests in the network console for chunks related to the adsense graphics

Screenshots

image


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 both adSenseModuleConnected and hasDismissedWidget are explicitly false (they return an undefined 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.

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:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
wpdarrencommented, Oct 31, 2022

@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?

0reactions
mohitwpcommented, Nov 2, 2022

QA Update ✅

Thank you @sashadoes.

Hi @mohitwp. Thanks for your question. I have not changed any file load logic within this ticket. Looks like the same files have different chanks on dev assuming the dev build is in place. I personally do not see any issues.

  • Verified on dev and latest environment.
  • On latest environment requests in the network console for chunks related to the AdSense graphics are getting load (31, 32 and 33).
  • On dev environment chunks related to the AdSense graphics are not getting load when CTA is dismissed. (31, 32 and 33).
  • When CTA is not dismissed then chunks related to the AdSense graphics are getting load on dev. (33.js,34.js and 35.js). Here in this case these files are different from the latest environment. On latest environment (31.js, 32.js and 33.js) chunks files are getting load. As per Sasha this is just case of having different chunks on dev environment.

Latest -

image

Dev :-


image

image

image

When CTA is not dismissed -

image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found