woocommerce / google-listings-and-ads

Sync your store with Google to list products for free, run paid ads, and track performance straight from your store dashboard.
https://woo.com/products/google-listings-and-ads/
GNU General Public License v3.0
47 stars 21 forks source link

Setup Wizard JS error #1641

Closed TimBHowe closed 2 years ago

TimBHowe commented 2 years ago

Describe the bug:

During the set up process we created a new Google Merchant Center and Google Ads account. After which we when back to try and import the product catalog to Google Merchant Center and where presented with a console error.

An error occurred  https://localhost.test/wp-includes/js/dist/data.min.js?ver=38ad563aa39c8f314fe6f6e430d81a69
data.min.js?ver=38ad563aa39c8f314fe6f6e430d81a69:1 An error occurred while running 'mapSelect': Cannot read properties of undefined (reading 'split')

TypeError: Cannot destructure https://localhost.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1
react-dom.min.js?ver=17.0.1:1 TypeError: Cannot destructure property 'code' of 'Mg(...)' as it is undefined.
    at $y (index.js?ver=f58e5c0fd5a6b625a32e70d20cd73ae1:9:24994)
    at Mv (index.js?ver=f58e5c0fd5a6b625a32e70d20cd73ae1:17:4464)
    at ct (react-dom.min.js?ver=17.0.1:1:43430)
    at os (react-dom.min.js?ver=17.0.1:1:111136)
    at Ur (react-dom.min.js?ver=17.0.1:1:77643)
    at Ir (react-dom.min.js?ver=17.0.1:1:77571)
    at Dr (react-dom.min.js?ver=17.0.1:1:77434)
    at Pr (react-dom.min.js?ver=17.0.1:1:74429)
    at react-dom.min.js?ver=17.0.1:1:30173
    at unstable_runWithPriority (react.min.js?ver=17.0.1:1:7431)
rr @ react-dom.min.js?ver=17.0.1:1

Uncaught (in promise) https://localhost.test/wp-content/plugins/google-listings-and-ads/js/build/index.js?ver=f58e5c0fd5a6b625a32e70d20cd73ae1
index.js?ver=f58e5c0fd5a6b625a32e70d20cd73ae1:2 Uncaught (in promise) TypeError: n.clone is not a function
    at index.js?ver=f58e5c0fd5a6b625a32e70d20cd73ae1:2:38861

With the main one seeming to be

Uncaught (in promise) https://localhost.test/wp-content/plugins/google-listings-and-ads/js/build/index.js?ver=f58e5c0fd5a6b625a32e70d20cd73ae1
index.js?ver=f58e5c0fd5a6b625a32e70d20cd73ae1:2 Uncaught (in promise) TypeError: n.clone is not a function
    at index.js?ver=f58e5c0fd5a6b625a32e70d20cd73ae1:2:38861

This doesn't seem to allow us to preceed with the set up

Steps to reproduce:

  1. Install and go through the set up process for the plugin
  2. Create new accounts for the Google Merchant Center and Google Ads

Expected behavior:

I was expecting to be able to have more control on setting up and managing a product fees that I could submit to Google Merchant Center.

Actual behavior:

We where stopped in our track due to the setup wizard.

WordPress Environment

WordPress address (URL): https://localhost.test Site address (URL): https://localhost.test WC Version: 6.8.0 REST API Version: ✔ 6.8.0 WC Blocks Version: ✔ 8.0.0 Action Scheduler Version: ✔ 3.4.0 Log Directory Writable: ✔ WP Version: ❌ 6.0 - There is a newer version of WordPress available (6.0.1) WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: – Language: en_US External object cache: –

Server Environment

Server Info: nginx/1.21.5 PHP Version: 8.1.8 PHP Post Max Size: 128 MB PHP Time Limit: 300 PHP Max Input Vars: 10000 cURL Version: 7.68.0 OpenSSL/1.1.1f

SUHOSIN Installed: – MySQL Version: 10.5.13-MariaDB-1:10.5.13+maria~focal Max Upload Size: 128 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔

Database

WC Database Version: 6.8.0 WC Database Prefix: wp_ Total Database Size: 15.67MB Database Data Size: 12.25MB Database Index Size: 3.42MB wp_woocommerce_sessions: Data: 1.50MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 0.11MB + Index: 0.11MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 0.06MB + Index: 0.03MB + Engine InnoDB wp_ac_segments: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_admin_columns: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_gf_draft_submissions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_gf_entry: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_entry_meta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_gf_entry_notes: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_form: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_gf_form_meta: Data: 0.06MB + Index: 0.00MB + Engine InnoDB wp_gf_form_revisions: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_form_view: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_rest_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gla_budget_recommendations: Data: 0.22MB + Index: 0.14MB + Engine InnoDB wp_gla_merchant_issues: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_gla_shipping_rates: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_gla_shipping_times: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_options: Data: 3.02MB + Index: 0.08MB + Engine InnoDB wp_postmeta: Data: 1.20MB + Index: 0.19MB + Engine InnoDB wp_posts: Data: 3.22MB + Index: 0.06MB + Engine InnoDB wp_redirection_404: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_redirection_groups: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_redirection_items: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_redirection_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_relevanssi: Data: 1.02MB + Index: 0.39MB + Engine InnoDB wp_relevanssi_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_relevanssi_stopwords: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_relevanssi_tracking: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_shortpixel_folders: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_shortpixel_meta: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_shortpixel_postmeta: Data: 0.06MB + Index: 0.08MB + Engine InnoDB wp_shortpixel_queue: Data: 0.09MB + Index: 0.09MB + Engine InnoDB wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.03MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_bundle_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_order_composite_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_bundled_itemmeta: Data: 0.06MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_bundled_items: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_yoast_indexable: Data: 0.16MB + Index: 0.09MB + Engine InnoDB wp_yoast_indexable_hierarchy: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_yoast_seo_links: Data: 0.06MB + Index: 0.03MB + Engine InnoDB

Post Type Counts

acf-field: 2 acf-field-group: 1 attachment: 105 customize_changeset: 6 global_product_addon: 1 nav_menu_item: 18 page: 16 post: 2 product: 33 revision: 148 shop_coupon: 1 wp_block: 2 wp_global_styles: 2

Security

Secure connection (HTTPS): ✔ Hide errors from visitors: ✔

Active Plugins (30)

Gravity Forms: by Gravity Forms – 2.6.5 Admin Columns Pro - Advanced Custom Fields (ACF): by AdminColumns.com – 3.0.3 Admin Columns Pro - Gravity Forms add-on: by AdminColumns.com – 1.2 Admin Columns Pro - WooCommerce: by AdminColumns.com – 3.7.3 Admin Columns Pro - Yoast SEO: by AdminColumns.com – 1.2 Admin Columns Pro: by AdminColumns.com – 5.7.3 Advanced Custom Fields PRO: by Delicious Brains – 5.12.2 Akismet Anti-Spam: by Automattic – 5.0 GTM4WP: by Thomas Geiger – 1.16.1 Google Listings and Ads: by WooCommerce – 2.0.4 Klaviyo: by Klaviyo Inc. – 3.0.3 Redirection: by John Godley – 5.3.2 Regenerate Thumbnails Advanced: by ShortPixel – 2.4.0 Relevanssi Premium: by Mikko Saari – 2.16.8 Safe SVG: by 10up – 2.0.2 ShortPixel Image Optimizer: by ShortPixel – 5.0.8 WooCommerce AvaTax: by SkyVerge – 1.16.0 (update to version 1.16.3 is available) WooCommerce Composite Products: by WooCommerce – 8.5.0 (update to version 8.5.2 is available) WooCommerce Cost of Goods: by SkyVerge – 2.11.1 WooCommerce Stripe Gateway: by WooCommerce – 6.6.0 WooCommerce Google Analytics Pro: by SkyVerge – 1.12.0 WooCommerce Product Add-ons: by WooCommerce – 5.0.0 WooCommerce Product Bundles: by WooCommerce – 6.15.5 (update to version 6.16.0 is available) WooCommerce: by Automattic – 6.8.1 WordPress Importer: by wordpressdotorg – 0.7 Yoast SEO: by Team Yoast – 19.5.1

Inactive Plugins (1)

Wordfence Security: by Wordfence – 7.6.0

Must Use Plugins (1)

Kinsta Must-use Plugins: by Kinsta Team – 2.4.8

Settings

API Enabled: – Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: bundle (bundle) composite (composite) external (external) grouped (grouped) simple (simple) variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5)

Connected to WooCommerce.com: – Enforce Approved Product Download Directories: –

WC Pages

Shop base: #6 - /shop/ Cart: #7 - /cart/ Checkout: #8 - /checkout/ My account: #9 - /my-account/ Terms and conditions: ❌ Page not set

Theme

Name: Scaffolding Version: 3.2 Author URL: https://www.hallme.com Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ✔

Templates

Overrides: –

Composite Products

Database Version: 8.5.0 Loopback Test: ✔ Template Overrides: –

Product Bundles

Database Version: 6.15.5 Loopback Test: ✔ Template Overrides: –

Admin

Enabled Features: activity-panels analytics coupons customer-effort-score-tracks experimental-products-task experimental-import-products-task experimental-fashion-sample-products experimental-product-tour shipping-smart-defaults shipping-setting-tour homescreen marketing mobile-app-banner navigation onboarding onboarding-tasks remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices wc-pay-promotion wc-pay-welcome-page wc-pay-subscriptions-page

Disabled Features: minified-js settings

Daily Cron: ✔ Next scheduled: 2022-08-19 16:39:29 -04:00 Options: ✔ Notes: 33 Onboarding: completed

Action Scheduler

Complete: 179 Oldest: 2022-07-19 12:55:27 -0400 Newest: 2022-08-18 17:55:02 -0400

Pending: 2 Oldest: 2022-08-19 13:28:02 -0400 Newest: 2022-08-19 15:43:02 -0400

Status report information

Generated at: 2022-08-19 09:31:39 -04:00

TimBHowe commented 2 years ago

I was able to restart the setup wizard process by manually deleting all the plugins options values in the DB

I found them using this

SELECT * FROM `wp_options` WHERE `option_name` LIKE '%gla_%'
TimBHowe commented 2 years ago

It looks like the issue comes from not being able to set the gla_mc_setup_completed_at time in the options db cause the js error

TimBHowe commented 2 years ago

Got it working by just manually gla_mc_setup_completed_at value with the current time stamp.

Suggestion. Give the option to skip the setup wizard and just enter Google Merchant Center and Google Ad ids. It doesn't need to be this complicated, or to connect to WordPress.com.

KISS principle

mikkamp commented 2 years ago

Suggestion. Give the option to skip the setup wizard and just enter Google Merchant Center and Google Ad ids. It doesn't need to be this complicated, or to connect to WordPress.com.

Thanks for the feedback. Although the setup wizard runs through a multi step connection process where additional steps like site verification are run in the background. So it's a little more involved then just entering the account ID's. However in the case that the JS frontend fails there is a fallback connection test, which is described here. That page has the option to enter a Merchant and Ads account ID and run through the onboarding steps.

TimBHowe commented 2 years ago

So I just needed to look in section 50 of the FAQ page for a URL to the setting pages that is not link anywhere from the back end of the site.

Might I suggest this /wp-admin/admin.php?page=connection-test-admin-page page be link some where in the WooCommerce > Settings section or WooCommerce > Status section

tomalec commented 2 years ago

@TimBHowe FYI, the fix was released in https://github.com/woocommerce/google-listings-and-ads/releases/tag/2.1.0