Skip to content

Notify users when an Ads account is suspended #2540

@joemcgill

Description

@joemcgill

Part of #2460

As a merchant, I want to know if my Ads account has been suspended so that I can correct the issues so I can continue getting visibility of my products to drive more sales.

image

We'll also update the Paid Ads card on the dashboard to show that the account is suspended:

image

Acceptance Criteria

  • When an Ads account is marked as suspended, show a dismissible error notice on the plugin screen above the tabs
  • The notice should persist across all tabs in the plugin screens
  • The notice should stop showing for the logged in user once it's been dismissed
  • Clicking the Resolve Issues link should take the user to the [TK URL]
  • Once the account is no longer suspended, the notice should disappear
  • If the ads account is suspended. The Paid Ads card on the dashboard should include "(Suspended)" in the title of the card (see design)

Implementation Brief

Create a new component called AdsAccountSuspended that exports a <Notice status="error" isDismissible={ true }> component with the text and CTA button from the designs. The component should check for the account status returned from the ads/connection response to see if it's suspended (details to follow).

If the account is suspended, return the notice, otherwise return null. Import the component into the Dashboard, Reports, ProductFeed, and Reports pages listed in /js/src/index.js. and display the component above the <MainTabNav /> component.

To add the suspended status to the ads/connection response, we'll update the AdsAccountQuery to include the 'customer.status' field. Add the status returned from that query to the array returned by Ads::get_account_details(), which will need to be made public so it can be accessed from the Ads\AccountService::get_connected_account() callback used by the API, so suspended can be returned as the 'status' when applicable.

To avoid calling the Google Ads API on each REST API request, we'll cache the customer status in a transient for HOUR_IN_SECONDS.

Test Coverage

  • Update the PHPUnit tests
  • Update the E2E tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: on holdThe issue is currently not prioritized.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions