| 1 |
<?php |
| 2 |
|
| 3 |
// View of General Statistics |
| 4 |
|
| 5 |
function pa_include_general( $current, $stats) { |
| 6 |
?> |
| 7 |
<div class="analytify_popup" id="general"> |
| 8 |
<div class="analytify_popup_header"> |
| 9 |
<h4>General Statistics</h4> |
| 10 |
<span class="analytify_popup_clsbtn">×</span> |
| 11 |
</div> |
| 12 |
<div class="analytify_popup_body"> |
| 13 |
<div class="table-responsive"> |
| 14 |
<table class="analytify_table analytify_table_hover"> |
| 15 |
<tbody> |
| 16 |
<tr> |
| 17 |
<th>SESSIONS</th> |
| 18 |
<td><?php echo number_format($stats->totalsForAllResults['ga:sessions']); ?></td> |
| 19 |
</tr> |
| 20 |
<tr> |
| 21 |
<th>USERS</th> |
| 22 |
<td><?php echo number_format($stats->totalsForAllResults['ga:users']); ?></td> |
| 23 |
</tr> |
| 24 |
<tr> |
| 25 |
|
| 26 |
<th style="min-width: 120px;">BOUNCE RATE</th> |
| 27 |
<td> |
| 28 |
<?php |
| 29 |
if ($stats->totalsForAllResults['ga:entrances'] <= 0) { ?> |
| 30 |
0.00% |
| 31 |
<?php |
| 32 |
} |
| 33 |
else { |
| 34 |
echo number_format(round(($stats->totalsForAllResults['ga:bounces'] / $stats->totalsForAllResults['ga:entrances']) * 100, 2), 2); |
| 35 |
?>% |
| 36 |
<?php } ?> |
| 37 |
</td> |
| 38 |
</tr> |
| 39 |
<tr> |
| 40 |
<th style="min-width: 145px;">AVG TIME ON SITE</th> |
| 41 |
<td> |
| 42 |
<?php |
| 43 |
if ($stats->totalsForAllResults['ga:sessions'] <= 0) { |
| 44 |
?> |
| 45 |
00:00:00 |
| 46 |
<?php |
| 47 |
} |
| 48 |
else { |
| 49 |
|
| 50 |
echo $current->pa_pretty_time($stats->totalsForAllResults['ga:avgSessionDuration']); |
| 51 |
?> |
| 52 |
<?php } ?> |
| 53 |
</td> |
| 54 |
</tr> |
| 55 |
<tr> |
| 56 |
<th style="min-width: 130px;">AVERAGE PAGES</th> |
| 57 |
<td> |
| 58 |
<?php |
| 59 |
if ($stats->totalsForAllResults['ga:sessions'] <= 0) { |
| 60 |
?> |
| 61 |
0.00 |
| 62 |
<?php |
| 63 |
} //$stats->totalsForAllResults['ga:sessions'] <= 0 |
| 64 |
else { |
| 65 |
?> |
| 66 |
<?php |
| 67 |
echo number_format(round($stats->totalsForAllResults['ga:pageviews'] / $stats->totalsForAllResults['ga:sessions'], 2), 2); |
| 68 |
?> |
| 69 |
<?php } ?> |
| 70 |
</td> |
| 71 |
</tr> |
| 72 |
<tr> |
| 73 |
<th style="min-width: 120px;">PAGE VIEWS</th> |
| 74 |
<td> |
| 75 |
<?php |
| 76 |
if ($stats->totalsForAllResults['ga:pageviews'] <= 0) { |
| 77 |
?> |
| 78 |
0 |
| 79 |
<?php |
| 80 |
} //$stats->totalsForAllResults['ga:sessions'] <= 0 |
| 81 |
else { |
| 82 |
?> |
| 83 |
<?php |
| 84 |
echo $current->wpa_number_format( $stats->totalsForAllResults['ga:pageviews'] ); |
| 85 |
?> |
| 86 |
<?php } ?> |
| 87 |
</td> |
| 88 |
</tr> |
| 89 |
<tr> |
| 90 |
<th style="min-width: 145px;">USER TYPE</th> |
| 91 |
<td> |
| 92 |
<?php |
| 93 |
if (isset($stats->totalsForAllResults)) |
| 94 |
{ |
| 95 |
$returning = $stats->totalsForAllResults['ga:sessions'] - $stats->totalsForAllResults['ga:newUsers']; |
| 96 |
?> |
| 97 |
New (<?php echo $stats->totalsForAllResults['ga:newUsers'];?>) |
| 98 |
Returning (<?php echo $returning;?>) |
| 99 |
<?php |
| 100 |
} |
| 101 |
?> |
| 102 |
</td> |
| 103 |
</tr> |
| 104 |
</tbody> |
| 105 |
</table> |
| 106 |
</div> |
| 107 |
</div> |
| 108 |
<div class="analytify_popup_footer"> |
| 109 |
<span class="analytify_popup_info"></span> These are the general statistics of this page. |
| 110 |
</div> |
| 111 |
</div> |
| 112 |
<?php } ?> |