google-listings-and-ads icon indicating copy to clipboard operation
google-listings-and-ads copied to clipboard

Improve debug logging/message when claimed url hash does not match site url hash

Open findingsimple opened this issue 3 years ago • 1 comments

User story

As a HE I want to be able to quickly identify that a site's claimed URL does not match site URL So that I can efficiently resolve merchants not being to able to sync

Is your feature request related to a problem?

GLA has a check in place to determine if a claimed site URL and site URL match - this is primarily to protect sites from submitting products for staging sites.

However, it can be a little unclear to Merchants and HEs when there IS a mismatch so it can be resolved quickly.

The error that will be most closely logged in this situation is

2022-09-01T04:43:12+00:00 ERROR Automattic\WooCommerce\GoogleListingsAndAds\Product\ProductSyncer::validate_merchant_center_setup Cannot sync any products before setting up Google Merchant Center.

But as we've seen in 5520525-zen the site can be fully connected/setup which creates confusion.

How to reproduce the problem

It is still unclear how this merchant in 5520525-zen got the claimed URL and site URL out of sync (looks like we clear original values).

To mimic the behavior the gla_claimed_url_hash option can be changed to an MD5 hash of a different url.

Describe the solution you'd like

Ideas

Screen Shot 2022-09-02 at 1 37 23 pm

Technical

  • n/a

Figma link

  • n/a

findingsimple avatar Sep 02 '22 04:09 findingsimple

In addition to reporting the status of the URL, I'd also suggest another tool on the connection test page to reset the site URL hash. Since it saves both an option and a transient that they match, it becomes a little harder to reset it manually. This would cover the first two steps which were performed in the ticket:

  1. Changed the WP_OPTIONS gla_claimed_url_hash value to the new hash via the options wp-admin page. It's the MD5 hash of the site URL.
  2. Ran wp transient delete gla_url_matches via WP CLI.

Note We were only able to reset the hash because the Merchant Account had the right URL. The easiest steps to rectify is just to perform a full disconnect / reconnect, which will use the new URL.

mikkamp avatar Sep 02 '22 07:09 mikkamp