I get this when viewing nodes:

"warning: Division by zero in /home/vughosting/public_html/drupal6-cluster1/public/sites/rickvug.com/modules/chart/chart.module on line 399."

Note sure yet if this happens 100% of the time or any other factors contribute to the issue. Going to say that this is critical.

Comments

AntiNSA’s picture

Im recieving exactly the same error. Not to mention analytics is failing to record any data.

AntiNSA’s picture

tried to install other analytics module to see...

RaRi’s picture

subscribe

seutje’s picture

I believe this is due to chart API module assuming the max value is ALWAYS over 0, which it isn't

-> #594202: Division by zero error

I could easily be wrong though

jkitching’s picture

Status: Active » Postponed (maintainer needs more info)

Rick, do you have any way I can reliably reproduce this bug?

seutje’s picture

for me it happens when the bounce rate for a certain page is 0% ... I think

stefan81’s picture

same issue here, in conjunction with chart API, if no Values in charts

j0k3z’s picture

Im also getting this error, and can confirm it seems to be connected to the bounce rate being zero

alberto56’s picture

Status: Postponed (maintainer needs more info) » Active

To reproduce go to reports/google_analytics_reports.module and temporarily change:

    $chart_bounce_rate[] = number_format($row['bounces'] / $row['uniquePageviews'] * 100, 2);

to

    $chart_bounce_rate[] = number_format(0 / $row['uniquePageviews'] * 100, 2);
      /* simulate bounce rate of zero */

Then view a chart of the bounce rate.

I applied #594202: Division by zero error as suggested by seutje in comment number 4, above; and that works.

In my opinion this is a chart problem but I'll let the maintainer confirm that. Thanks,

Albert.

alberto56’s picture

Title: Warning error when viewing nodes » Division by zero error when viewing a report and bounce rate is zero

changing the title to be more descriptive

raspberryman’s picture

Assigned: Unassigned » raspberryman
Status: Active » Closed (fixed)

The best direction is to get these patches applied to chart module: http://drupal.org/node/594202

However, I added a little tweak to help avoid this for the time being. I'd like to move away from this solution in the future but it should work for now: http://drupalcode.org/project/google_analytics_api.git/commitdiff/fbe4acc