• Hi,

    I am getting this error repeatedly on different sites that I am running the Google Analytics Plugin on.

    What happens is:

    I login as Admin and get the message at the top that I need to link the Google Analytics Plugin to a Google Analytics account although I have done this multiple times.

    I click to do this and then this message comes up:

    Fatal error: Call to a member function set_defaults() on a non-object in /home/buyrarei/public_html/swissmetalassets.com/wp-content/plugins/google-analytics-for-wordpress/googleanalytics.php on line 1517

    Entire site including admin then goes offline for 5 – 10 minutes and displays the same message no matter what page you try to access.

    Something seems to reset itself after 5 – 10 minutes and then I can login again as Admin and link the Plugin to my Google Analytics account and it seems to work again for a while.

    On some of my sites this only happens occasionally and on others it has happened up to 20 times in one day while I am trying to add new posts or do something on the site.

    Any suggestions?

    Thanks,

    Mike

    https://www.ads-software.com/extend/plugins/google-analytics-for-wordpress/

Viewing 3 replies - 1 through 3 (of 3 total)
  • I had this same issue.

    Around line 1515 on googleanalytics.php, change:
    if (!is_array($options)) {

    To:
    if (!is_array($options) && class_exists('GA_Admin')) {

    Thanks for the tip for where to look. For whatever reason, that didn’t work. But I did something similar and changed

    $ga_admin->set_defaults();

    to

    if ($ga_admin) $ga_admin->set_defaults();

    and it appears to be working correctly.

    One thought though. Does this only happen when the plugin is network activated? I didn’t try it before the fix, but after I turned off network activate and left it to be manually activated on each site so I can leave it off if needed.

    That will resolve the error, but can not activate tracking in admin panel

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Google Analytics for WordPress] Fatal error: Call to a member function set_defaults() on a’ is closed to new replies.