Title: PHP Fatal error: Uncaught DivisionByZeroError
Last modified: March 7, 2022

---

# PHP Fatal error: Uncaught DivisionByZeroError

 *  Resolved [tmuka](https://wordpress.org/support/users/tmuka/)
 * (@tmuka)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-divisionbyzeroerror/)
 * Using google-analytics-for-wordpress v8.4.0 I’m setting this fatal error on several
   sites with WordPress 5.9.1 and php
 * `PHP Fatal error: Uncaught DivisionByZeroError: Division by zero in wp-content/
   plugins/google-analytics-for-wordpress/includes/admin/notifications/notification-
   upgrade-eu-traffic.php:43`
 * My hunch is that the error is because the plugin doesn’t have a value set for
   $sessions in the report data. One site uses a manually entered UA Code, and another
   has an expired GA authentication session.
 * Hope this helps detect this case and avoid the PHP Fatal Error!

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

 *  Thread Starter [tmuka](https://wordpress.org/support/users/tmuka/)
 * (@tmuka)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-divisionbyzeroerror/#post-15438186)
 * It got cut off above. I’m using PHP 8.0.16.
 * for now I added this code on line 37 to stop the fatal errors.
    `if(! is_numeric(
   $sessions) || $sessions == 0 ){ return false; }`
    -  This reply was modified 4 years, 3 months ago by [tmuka](https://wordpress.org/support/users/tmuka/).
 *  Plugin Support [Michelle D.](https://wordpress.org/support/users/devmich/)
 * (@devmich)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-divisionbyzeroerror/#post-15451428)
 * Hi [@tmuka](https://wordpress.org/support/users/tmuka/),
 * Thanks for this information. I’m so sorry about the trouble!
 * I’ve let our developer team know about it and they’re working on resolving the
   issue.
 * We really appreciate you for bringing this to our attention!
 * Please let me know if there’s anything else I can help with. Or if you would 
   rather, feel free to reach out to us at [https://www.monsterinsights.com/lite-support/](https://www.monsterinsights.com/lite-support/)
   🙂
 * Thank you!

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

The topic ‘PHP Fatal error: Uncaught DivisionByZeroError’ is closed to new replies.

 * ![](https://ps.w.org/google-analytics-for-wordpress/assets/icon.svg?rev=2976619)
 * [MonsterInsights - Google Analytics Dashboard for WordPress (Website Stats Made Easy)](https://wordpress.org/plugins/google-analytics-for-wordpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-analytics-for-wordpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-analytics-for-wordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/google-analytics-for-wordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-analytics-for-wordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-analytics-for-wordpress/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Michelle D.](https://wordpress.org/support/users/devmich/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-divisionbyzeroerror/#post-15451428)
 * Status: resolved