Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.