• Resolved boydedmondson

    (@boydedmondson)


    Hi team,

    I’m encountering a JavaScript error when using the Google Listings & Ads plugin in WooCommerce.

    Steps to Reproduce:

    1. Navigate to Marketing > Google for WooCommerce.
    2. Create or edit a campaign.
    3. Go to the “Optimize your campaign” step.
    4. Click “Select Final URL” and choose the Shop page (/shop/).
    5. The plugin crashes and shows a white screen with the error message below.

    Error Message:

    TypeError: Cannot read properties of undefined (reading ‘split’)
    File trace shows it originates in:
    /wp-content/plugins/google-listings-and-ads/js/build/dashboard.js
    … and is also referenced in WooCommerce assets like:
    /wp-content/plugins/woocommerce/assets/client/admin/components/index.js

    This only happens when the Shop page is selected.

    Diagnostic Info:

    • Plugin: Google Listings & Ads version 2.10.1
    • WooCommerce: version 9.0.1
    • Theme: Reproduced with both custom theme and default WordPress themes
    • Site Permalinks: Valid and resaved
    • Shop Page: Correctly assigned in WooCommerce > Settings > Products
    • Cache: Cleared all browser/site/server/CDN caches
    • Cookies: Tested before and after clearing browser cookies
    • Console Output: No critical JS errors except this one
    • Browser: Chrome latest

    The REST API returns this for the Shop page:

    [ { “id”: 58, “slug”: “shop”, “link”: “https://nebulasoftware.com/shop/“, “title”: { “rendered”: “Shop” }, … } ]

    I’ve also confirmed:

    • The Shop page renders correctly in the front end and displays products.
    • Console shows no other issues related to the page.
    • All plugins are up to date.
    • I disabled all other plugins (except WooCommerce and Google Listings & Ads) to isolate the issue, but it still occurs.

    Summary:

    It looks like your JavaScript is calling .split() on an undefined variable, likely when parsing a value related to the Shop page. The REST data and slug look valid, so this appears to be a logic bug in the plugin itself.

    Site URL and System Status report below:

    https://nebulasoftware.com System Status Report

    ### WordPress Environment ###
    
    WordPress address (URL): [Redacted]
    Site address (URL): [Redacted]
    WC Version: 9.8.1
    Legacy REST API Package Version: The Legacy REST API plugin is not installed on this site.
    Action Scheduler Version: ✔ 3.9.2
    Log Directory Writable: ✔
    WP Version: 6.7.2
    WP Multisite: –
    WP Memory Limit: 512 MB
    WP Debug Mode: –
    WP Cron: ✔
    Language: en_US
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache
    PHP Version: 8.2.28
    PHP Post Max Size: 300 MB
    PHP Time Limit: 500
    PHP Max Input Vars: 3000
    cURL Version: 8.12.1
    OpenSSL/3.3.3
    
    SUHOSIN Installed: –
    MySQL Version: 8.0.33-25
    Max Upload Size: 64 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ✔
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔
    
    ### Database ###
    
    [REDACTED]
    
    ### Post Type Counts ###
    
    attachment: 46
    custom_css: 3
    mgmlp_media_folder: 14
    nav_menu_item: 13
    page: 28
    post: 1
    product: 7
    revision: 1
    wp_font_face: 36
    wp_font_family: 12
    wp_global_styles: 5
    wp_navigation: 2
    wp_template_part: 2
    wpcode: 2
    wpforms: 3
    
    ### Security ###
    
    Secure connection (HTTPS): ✔
    Hide errors from visitors: ✔
    
    ### Active Plugins (26) ###
    
    CoBlocks: by GoDaddy – 3.1.15
    Customizer Export/Import: by The Beaver Builder Team – 0.9.8
    Enable Media Replace: by ShortPixel – 4.1.6
    File Renaming on upload: by WPFactory – 2.6.4
    Flush All Caches: by Nebula Software – 2.6
    Google for WooCommerce: by WooCommerce – 2.9.10
    IndexNow: by Microsoft Bing – 1.0.3
    Media Cleaner (Pro): by Jordy Meow – 6.8.7
    Regenerate Thumbnails Advanced PRO: by ShortPixel – 1.0.0
    Regenerate Thumbnails Advanced: by ShortPixel – 2.5.0
    ShortPixel Image Optimizer: by ShortPixel - Convert WebP/AVIF & Optimize Images – 6.1.4
    WooCommerce.com Update Manager: by Automattic – 1.0.3
    WooPayments: by WooCommerce – 9.2.0
    WooCommerce Shipping & Tax: by WooCommerce – 2.8.9
    WooCommerce Shipping: by WooCommerce – 1.6.4
    WooCommerce Subscriptions: by WooCommerce – 7.3.1
    WooCommerce: by Automattic – 9.8.1
    Yoast SEO Premium: by Team Yoast – 24.8
    Yoast SEO: by Team Yoast – 24.8.1
    WP Rocket: by WP Media – 3.18.3
    WP User Profile Avatar: by WP Event Manager – 1.0.6
    WPForms Geolocation: by WPForms – 2.11.0
    WPForms Mailchimp: by WPForms – 2.4.0
    WPForms User Journey: by WPForms – 1.4.0
    WPForms: by WPForms – 1.9.4.2
    Yoast SEO: WooCommerce: by Team Yoast – 16.5
    
    ### Inactive Plugins (0) ###
    
    
    ### Dropin Plugins () ###
    
    advanced-cache.php: advanced-cache.php
    db-error.php: db-error.php
    object-cache.php: object-cache.php
    
    ### Must Use Plugins (3) ###
    
    Object Cache Pro (MU): by Rhubarb Group – 1.21.2
    SSO: by Garth Mortensen
    Mike Hansen – 0.5
    
    System Plugin: by  – 4.165.0
    
    ### Settings ###
    
    Legacy API Enabled: –
    Force SSL: ✔
    Currency: USD ($)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    subscription (subscription)
    variable (variable)
    variable subscription (variable-subscription)
    
    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: ✔
    HPOS feature enabled: ✔
    Order datastore: GoDaddy\WordPress\MWC\Core\Features\Commerce\Orders\WooCommerce\OrderDataStore
    HPOS data sync enabled: ✔
    
    ### Logging ###
    
    Enabled: ✔
    Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2
    Retention period: 7 days
    Level threshold: –
    Log directory size: 123 KB
    
    ### WC Pages ###
    
    Shop base: #58 - /shop/
    Cart: #77 - /cart/ -  Contains the woocommerce_cart shortcode
    Checkout: #76 - /checkout/ -  Contains the woocommerce_checkout shortcode
    My account: #65 - /my-account/ -  Contains the [woocommerce_my_account] shortcode
    Terms and conditions: #642 - /terms-and-conditions/
    
    ### Theme ###
    
    Name: Twenty Twenty-Five
    Version: 1.1
    Author URL: https://ww.wp.xz.cn
    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
    Theme type: Block theme
    WooCommerce Support: ❌ Not declared
    
    ### Templates ###
    
    Overrides: /var/www/wp-content/plugins/woocommerce/templates/block-notices/error.php
    /var/www/wp-content/plugins/woocommerce/templates/block-notices/notice.php
    /var/www/wp-content/plugins/woocommerce/templates/block-notices/success.php
    
    
    ### WooPayments ###
    
    Version: 9.2.0
    Connected to WPCOM: Yes
    WPCOM Blog ID: 158635321
    Account ID: acct_1QrQUHCAUq2S2E9E
    Payment Gateway: Enabled
    Test Mode: Disabled
    Enabled APMs: card
    WooPay: Enabled (product,cart,checkout)
    WooPay Incompatible Extensions: No
    Apple Pay / Google Pay: Enabled (product,cart,checkout)
    Fraud Protection Level: advanced
    Enabled Fraud Filters: AVS Verification,Address Mismatch,IP Address Mismatch,Order Items Threshold,Purchase Price Threshold
    Multi-currency: Enabled
    Auth and Capture: Disabled
    Documents: Disabled
    Logging: Disabled
    
    ### Subscriptions ###
    
    WCS_DEBUG: ✔ No
    Subscriptions Mode: ✔ Live
    Subscriptions Live URL: https://nebulasoftware.com
    Subscriptions-core Library Version: 8.1.1
    Subscription Statuses: –
    WooCommerce Account Connected: ✔ Yes
    Active Product Key: ✔ Yes
    Custom Retry Rules: ✔ No
    Custom Retry Rule Class: ✔ No
    Custom Raw Retry Rule: ✔ No
    Custom Retry Rule: ✔ No
    Retries Migration Status: ✔ Completed
    Report Cache Enabled: ✔ Yes
    Cache Update Failures: ✔ 0 failure
    
    ### Store Setup ###
    
    Country / State: United States (US) — Arizona
    
    ### Subscriptions by Payment Gateway ###
    
    
    ### Payment Gateway Support ###
    
    WooPayments: products
    refunds
    multiple_subscriptions
    subscription_cancellation
    subscription_payment_method_change_admin
    subscription_payment_method_change_customer
    subscription_payment_method_change
    subscription_reactivation
    subscription_suspension
    subscriptions
    subscription_amount_changes
    subscription_date_changes
    tokenization
    add_payment_method
    
    
    ### Admin ###
    
    Enabled Features: activity-panels
    analytics
    product-block-editor
    coupons
    core-profiler
    customize-store
    customer-effort-score-tracks
    import-products-task
    experimental-fashion-sample-products
    shipping-smart-defaults
    shipping-setting-tour
    homescreen
    marketing
    mobile-app-banner
    onboarding
    onboarding-tasks
    pattern-toolkit-full-composability
    product-custom-fields
    remote-inbox-notifications
    remote-free-extensions
    payment-gateway-suggestions
    printful
    shipping-label-banner
    subscriptions
    store-alerts
    transient-notices
    woo-mobile-welcome
    wc-pay-promotion
    wc-pay-welcome-page
    launch-your-store
    add-to-cart-with-options-stepper-layout
    
    Disabled Features: product-data-views
    experimental-blocks
    coming-soon-newsletter-template
    minified-js
    product-pre-publish-modal
    settings
    async-product-editor-category-field
    product-editor-template-system
    use-wp-horizon
    blockified-add-to-cart
    
    Daily Cron: ✔ Next scheduled: 2025-04-12 08:49:23 -07:00
    Options: ✔
    Notes: 3
    Onboarding: completed
    
    ### Action Scheduler ###
    
    Canceled: 2
    Oldest: 2025-03-11 09:16:32 -0700
    Newest: 2025-03-13 08:05:37 -0700
    
    Complete: 27,077
    Oldest: 2025-03-12 11:51:03 -0700
    Newest: 2025-04-11 05:49:25 -0700
    
    Failed: 95
    Oldest: 2025-02-01 07:31:16 -0700
    Newest: 2025-04-11 05:49:24 -0700
    
    Pending: 18
    Oldest: 2025-04-11 05:50:24 -0700
    Newest: 2025-04-18 05:45:42 -0700
    
    
    ### Status report information ###
    
    Generated at: 2025-04-11 05:49:52 -07:00
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @boydedmondson,

    I understand how frustrating it is to deal with a persistent JavaScript error, especially when it disrupts your workflow. Based on your report, the error “TypeError: Cannot read properties of undefined (reading ‘split’)” indicates that the plugin is trying to call .split() on an undefined value. Since this happens when you select your Shop page during campaign creation, it points to a possible bug in the Google Listings & Ads plugin itself or your settings/connection to other services.

    To help troubleshoot this further, could you please try the following steps:

    • Disconnect and Reconnect:
      Disconnect all your connection settings for the Google for WooCommerce plugin. Then, clear all caches (browser, site, server, and CDN if applicable). After that, go through the connection setup again. Sometimes stale or misconfigured connection data can cause issues like this.
    • Review Error Logs:
      Please check for any additional error logs by navigating to WooCommerce > Status > Logs. Sharing these logs can provide more insight into what’s going wrong. You can share them using a service like https://pastebin.com or https://quickshare.com.
    • Confirm Consistent Behavior:
      Let us know if the error happens every time you select the Shop page or if other pages are affected as well. This will help us narrow down whether it’s an isolated issue or something broader.

    Your REST API data for the Shop page appears correct, so this is likely a processing issue within the plugin’s JavaScript. Once you’ve tried disconnecting/reconnecting and shared any error logs, we should be in a better position to diagnose the issue further.

    Thank you for your patience. I’m here to help as we work through this together.

    Thread Starter boydedmondson

    (@boydedmondson)

    Thanks for the information and steps!

    Disconnect/Flush/Reconnect failed to fix it.

    Error Logs: https://drive.google.com/file/d/1aIUOD3oQSDdmJ5aswQq4PqOGl63hQ4Mi/view?usp=sharing

    Consistent behavior? Yes, “Grant access” fails every time with the same error. I don’t know of any other pages that are having errors because of this.

    Zee

    (@doublezed2)

    Hello boydedmondson,

    Thank you for your reply.

    I understand you are facing issue with Google for WooCommere plugin.

    Please note that this forum is intended for WooCommerce core support. Therefore, I recommend creating a new topic at Google for WooCommerce support forum.

    When you create a new topic, please put a link to this thread so you can continue the conversation and spend time asking the same questions.

    Also, please share more details about this error on the new topic. Sharing screenshots would be helpful.
    “Grant access” fails every time with the same error.

    Best regards.

    Thread Starter boydedmondson

    (@boydedmondson)

    Since then, I have gone directly to Google Merchant account and created it there. Now when in WordPress the error is bypassed, probably because I set the Final URL page externally.

    Hi @boydedmondson,

    Nice work taking that approach—glad to hear you’ve managed to resolve the issue on your end! If you run into any other problems, feel free to open a new topic, as @doublezed2 mentioned. This forum is dedicated to issues related to WooCommerce core.

    In the meantime, since you’re using WooCommerce, we’d really appreciate it if you could leave an honest review of the plugin. Your feedback helps us improve:
    👉 Leave a review here

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘TypeError: Cannot read properties of undefined (reading ‘split’)’ is closed to new replies.