Jump to content

Average...


The Little Guy

Recommended Posts

I'd say $row['uniqueCount'] / $row['totalCount']

 

Wouldn't that always return a number less than 1, though? I think he has the right of it, since he wants an average number of page hits per visit... so:

 

<?php
$total = 100; // 100 page hits
$users = 10; // 10 unique visitors
$avg = $total / $users; // 10 hits per visitor
?>

 

This would not be accurate:

<?php
$total = 100; // 100 page hits
$users = 10; // 10 unique visitors
$avg = $users / $total; // 1/10 hits per visitor -- makes no sense
?>

Link to comment
https://forums.phpfreaks.com/topic/124336-average/#findComment-642066
Share on other sites

using Mchl's code, could I find a bouce rate percentage?

 

bounce rate = The percentage of visits where the visitor enters and exits at the same page without visiting any other pages on the site in between.

 

$pagesAccessed = 1000;
$uniquePeople = 100;

$bounceRate = ($uniquePeople / $pagesAccessd) * 100;

Link to comment
https://forums.phpfreaks.com/topic/124336-average/#findComment-643224
Share on other sites

using Mchl's code, could I find a bouce rate percentage?

 

bounce rate = The percentage of visits where the visitor enters and exits at the same page without visiting any other pages on the site in between.

 

$pagesAccessed = 1000;
$uniquePeople = 100;

$bounceRate = ($uniquePeople / $pagesAccessd) * 100;

 

You really can't find a bounce rate unless you know exactly how many pages came from each individual user. Your number of page hits really doesn't apply to the bounce rate average, since "bounce" is actually like a boolean for each user. So, if you have hits per user, you could calculate it if you're careful.

Link to comment
https://forums.phpfreaks.com/topic/124336-average/#findComment-643253
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.