Google Analytics Division by Zero

This topic contains 6 replies, has 3 voices, and was last updated by  Paolo 10 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #10174

    identity
    Lifetime Member
    Post count: 445

    Looking at one of my test listings, noticed that the Google Analytics stats came back with a system error message:

    Warning: Division by zero in /home/example/public_html/c/wp-content/plugins/geodirectory/geodirectory-functions/google_analytics.php on line 61
    Google Analytics (Last 30 Days)
    Total pageviews: 1
    Unique visitors: 1
    Average time on page: 0:00:00

    Cheers,
    Brian

    #10192

    Guust
    Moderator
    Post count: 29970

    I had a look at one of my sites, that runs all the latest GD and GDF, and I don’t get any errors at all. I attach 2 pics to show?

    #10256

    Paolo
    Site Admin
    Post count: 31206

    To avoid getting such warning, you should turn debug off or only log them and avoid to print them on screen.

    Being that a warning and not an error, it will not prevent your website from working correctly.

    Thx

    #10259

    identity
    Lifetime Member
    Post count: 445

    Paolo,

    Thanks. I don’t think so, but is there a setting for that in GD I’m missing?

    Otherwise, I’m assuming it is a php.ini setting, but to my knowledge, all of those warnings/errors are most likely turned off already.

    Cheers,
    Brian

    #10260

    Paolo
    Site Admin
    Post count: 31206

    Hi Brian,

    please try adding this to the top of your child theme functions.php after the opening php tag

    
    
    error_reporting(E_ERROR);
    

    It should stop that.

    Let me know,

    #10264

    identity
    Lifetime Member
    Post count: 445

    Thanks. Added, though at the moment, not seeing the error anyway. Tried viewing a few more listings that had not stats yet, so will see if it pops up again tomorrow or not.

    It might be an edge case anyway.

    Cheers,
    Brian

    #10267

    Paolo
    Site Admin
    Post count: 31206

    Cool, let us know! 🙂

Viewing 7 posts - 1 through 7 (of 7 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount