site-kit-wp: "Error: Ad Client not found" error and continuous AdSense loading bar in place of "We're getting your site ready for ads"

Bug Description

There have been numerous support topics open this week which all feature an AdSense related error as below: connection Error: Ad Client not found.

This notice appears in the dashboard for users, I suspect when users have non approved AdSense accounts (or they may have been flagged for having multiple accounts)

In addition to the dashboard notice the AdSense module progress bar remains loading if a user us to press the “Continue” button - when this notice re-appears as a console error, see below:

image

These are new issues which only started occurring in the past 24 hours. Awaiting additional information from end users impacted below:

Steps to reproduce

  1. Setup Site Kit on a Google account which is not associated with a an AdSense account
  2. Connect the AdSense module
  3. An AdSense account won’t be found, follow the AdSense account setup procedure by following the steps within Site Kit
  4. Issue occurs

Additional Context

  • Occurs with both new and existing AdSense users (one who reported ads working previously, although account may have since been flagged at AdSense level)
  • Some sites have the Site Kit placed AdSense code evident in their source code
  • From the user who shared their SH info they do have an approved AdSense account, awaiting feedback on their site level approval
  • One user reports that they do not have an approved AdSense account yet. They attempted to fix the issue and reapplied.
  • No ads rendering on any of the sites listed
  • One support topic references not being able to manually ad their site (before SK).
  • No redirects are in place for 2 of the sites impacted, with their site non secure and a 404 when accessing their https site
  • Awaiting any console errors, no screenshots or videos of this experience so far
  • No common console errors on the front page of a users site when checking support side (one user does have a "message: “adsbygoogle.push() error: Only one ‘enable_page_level_ads’ allowed per page.” error although this doesn’t impact ads rendering.

Ideally a user would see a “We’re getting your site ready for ads” notice within Site Kit, as impacted users would see when they access their AdSense platform. This was the way it worked previously within Site Kit.

image


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • During AdSense setup / settings, if the getURLChannels API request results in an error “Ad Client not found”, it should result in the ACCOUNT_STATUS_PENDING status to be used.
  • In other words, the determineAccountStatus function should also support receiving a urlChannelsError and if it’s the above error, it should return ACCOUNT_STATUS_PENDING. This should be handled via a new urlChannelsErrorToStatus function, which is also called by errorToStatus, so that that particular error message does not actually show to the user as an error.

Implementation Brief

  • Check whether the existingURLChannels.error is not empty in the getURLChannels resolver and yield receiveError( existingURLChannels.error, 'getURLChannels', [ accountID, clientID ] ) before returning;
  • Select the error for the getURLChannels selector in the SetupMain component and pass it to the determineAccountStatus function;
  • Update the determineAccountStatus function to check the error for the getURLChannels selector and if it is not empty and the message contains Ad Client not found, then return ACCOUNT_STATUS_PENDING;
  • Add a new function urlChannelsErrorToStatus next to the alertsErrorToStatus function (and use it as an example);
    • This function should return the ACCOUNT_STATUS_PENDING if the current error is Ad Client not found. Otherwise return undefined.
  • Update the errorToStatus function to call the urlChannelsErrorToStatus and return its results if accountsErrorToStatus and alertsErrorToStatus returned nothing.

Test Coverage

  • Update determineAccountStatus tests to test the new selector;
  • Update other tests if any is broken due to the aforementioned changes.

Visual Regression Changes

  • N/A

QA Brief

  • Setup Site Kit on a Google account which is not associated with a an AdSense account
  • Connect the AdSense module
  • An AdSense account won’t be found, follow the AdSense account setup procedure by following the steps within Site Kit
  • You should see the message “We’re getting your site ready for ads. This usually takes less than a day, but it can sometimes take a bit longer”, not the “ad client not found” error message.

Changelog entry

  • Fix AdSense bug where Ad Client not found error would be displayed in certain cases where an account is still pending.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (4 by maintainers)

Most upvoted comments

Thanks for opening this and adding steps to reproduce @jamesozzie!

@felixarntz ok, updated. Ready for review.

Hi, I had the same problem with “Error: Ad client not found”. However I confirmed in the checkbox in Adsense that my script code just was copy and then Adsense is show me right now a message “we are reviewing your website”. Meanwhile, in Wordpress always is the same status: loading. Sometimes is loading and sometimes it shows me the message “Error: Ad client not found” flashing. Is that correct? Can someone guide me a little if this is correct? image

For those impacted please check whether you have an approved AdSense account and site. From testing so far this can occur on an account which is not yet approved, evident from accessing the AdSense platform.

image