RankMath does not connect to Google Analytics, PHP error on line 82 on setup

#807795
  • Resolved Anonymous
    Rank Math free

    Good day,

    I have tried everything that I could find on community blogs and google. Tried the troubleshooting steps by disabling all the plugins and ensured that there is no conflict between the plugins. cleared cache, rebuild data as per ticket #528385.

    I get this error every time I try to connect to Google:

    [22-May-2024 10:27:18 UTC] PHP Warning: foreach() argument must be of type array|object, null given in /home/dupionline-matech/htdocs/matech.dupionline.xyz/wp-content/plugins/seo-by-rank-math/includes/modules/analytics/google/class-analytics.php on line 82

    Here is my System Info:

    `
    ### rank-math ###

    version: 1.0.219
    database_version: 1
    plugin_plan: Free
    0: Free
    1: 750
    2: 2024-06-20 10:07 pm
    active_modules: link-counter, analytics, seo-analysis, sitemap, rich-snippet, content-ai, instant-indexing, role-manager
    refresh_token: Token exists
    permissions:
    Search Console: Given
    rank_math_404_logs: Not found
    rank_math_redirections: Not found
    rank_math_redirections_cache: Not found
    rank_math_internal_links: 32 KB
    rank_math_internal_meta: 16 KB
    rank_math_analytics_gsc: 80 KB
    rank_math_analytics_objects: 32 KB
    rank_math_analytics_inspections: 128 KB

    ### wp-core ###

    version: 6.5.3
    site_language: en_US
    user_language: en_US
    timezone: +02:00
    permalink: /%postname%
    https_status: true
    multisite: false
    user_registration: 0
    blog_public: 1
    default_comment_status: undefined
    environment_type: production
    user_count: 2
    dotorg_communication: true

    ### wp-dropins (1) ###

    object-cache.php: true

    ### wp-active-theme ###

    name: OceanWP (oceanwp)
    version: 3.5.5
    author: OceanWP
    author_website: https://oceanwp.org/about-oceanwp/
    parent_theme: none
    theme_features: core-block-patterns, widgets-block-editor, align-wide, wp-block-styles, responsive-embeds, editor-styles, editor-style, menus, post-formats, title-tag, automatic-feed-links, post-thumbnails, custom-header, custom-logo, html5, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, customize-selective-refresh-widgets, widgets
    theme_path: /home/dupionline-matech/htdocs/matech.dupionline.xyz/wp-content/themes/oceanwp
    auto_update: Enabled

    ### wp-mu-plugins (1) ###

    Health Check Troubleshooting Mode: author: (undefined), version: 1.9.1

    ### wp-plugins-active (13) ###

    Duplicate Page: version: 4.5.3, author: mndpsingh287, Auto-updates enabled
    Elementor: version: 3.21.6, author: Elementor.com, Auto-updates enabled
    Health Check & Troubleshooting: version: 1.7.0, author: The WordPress.org community, Auto-updates enabled
    LiteSpeed Cache: version: 6.2.0.1, author: LiteSpeed Technologies, Auto-updates enabled
    Ocean Extra: version: 2.2.7, author: OceanWP, Auto-updates enabled
    Ocean Social Sharing: version: 2.0.7, author: OceanWP, Auto-updates enabled
    Qi Addons For Elementor: version: 1.7.1, author: Qode Interactive, Auto-updates enabled
    Rank Math SEO with AI Best SEO Tools: version: 1.0.219, author: Rank Math, Auto-updates enabled
    The Post Grid: version: 7.7.3, author: RadiusTheme, Auto-updates enabled
    TinyPNG – JPEG, PNG & WebP image compression: version: 3.4.3, author: TinyPNG, Auto-updates enabled
    Wordfence Security: version: 7.11.5, author: Wordfence, Auto-updates enabled
    WordPress Importer: version: 0.8.2, author: wordpressdotorg, Auto-updates enabled
    WPForms Lite: version: 1.8.8.3, author: WPForms, Auto-updates enabled

    ### wp-server ###

    server_architecture: Linux 6.5.0-1021-oracle x86_64
    httpd_software: nginx/1.21.4
    php_version: 8.0.30 64bit
    php_sapi: fpm-fcgi
    max_input_variables: 10000
    time_limit: 60
    memory_limit: 512M
    max_input_time: 60
    upload_max_filesize: 64M
    php_post_max_size: 64M
    curl_version: 7.81.0 OpenSSL/3.0.2
    suhosin: false
    imagick_availability: true
    pretty_permalinks: true
    htaccess_extra_rules: true
    current: 2024-05-22T10:51:41+00:00
    utc-time: Wednesday, 22-May-24 10:51:41 UTC
    server-time: 2024-05-22T12:51:39+02:00

    ### wp-database ###

    extension: mysqli
    server_version: 8.0.36-0ubuntu0.22.04.1
    client_version: mysqlnd 8.0.30
    max_allowed_packet: 67108864
    max_connections: 512

    ### wp-constants ###

    WP_HOME: undefined
    WP_SITEURL: undefined
    WP_CONTENT_DIR: /home/dupionline-matech/htdocs/matech.dupionline.xyz/wp-content
    WP_PLUGIN_DIR: /home/dupionline-matech/htdocs/matech.dupionline.xyz/wp-content/plugins
    WP_MEMORY_LIMIT: 40M
    WP_MAX_MEMORY_LIMIT: 512M
    WP_DEBUG: false
    WP_DEBUG_DISPLAY: false
    WP_DEBUG_LOG: true
    SCRIPT_DEBUG: false
    WP_CACHE: true
    CONCATENATE_SCRIPTS: false
    COMPRESS_SCRIPTS: undefined
    COMPRESS_CSS: undefined
    WP_ENVIRONMENT_TYPE: Undefined
    WP_DEVELOPMENT_MODE: undefined
    DB_CHARSET: utf8
    DB_COLLATE: undefined

    ### wp-filesystem ###

    wordpress: writable
    wp-content: writable
    uploads: writable
    plugins: writable
    themes: writable
    mu-plugins: writable

    Google connect services image: https://imgur.com/a/bFgh4Hj

    Please could you kindly assist,

    Regards, Lionel

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting us and sorry for any inconvenience that this issue might have caused.

    Please ensure that you are using the latest version of Rank Math plugin. If not yet, please do update them. You may refer to our changelog page here: https://rankmath.com/changelog/

    Could you please also confirm if you have already created a GA4 property for your website?
    https://rankmath.com/kb/using-ga4/#create-ga4-property

    Also, if the settings are not getting saved in the Analytics, please try using Google Chrome (Incognito mode) or another Chromium-based browser upon reconnecting to save those settings.

    We have seen this in the past when people were using Safari on macOS or the Firefox browser, so if you are using any of these combinations, the data might not get saved.

    Let us know how this goes.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘RankMath does not connect to Google Analytics, PHP error on line 82 on setup’ is closed to new replies.