PluginProbe
Analytify – Google Analytics Dashboard For WordPress (GA4 analytics tracking) / 1.0.3
Analytify – Google Analytics Dashboard For WordPress (GA4 analytics tracking) v1.0.3
9.1.2 9.1.1 9.1.0 9.0.2 9.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 All 153 releases
wp-analytify / views / admin / single-general-stats.php

single-general-stats.php in Analytify – Google Analytics Dashboard For WordPress (GA4 analytics tracking) 1.0.3, at views/admin/single-general-stats.php

154 lines 5.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * View of General Statistics
5 */
6
7 function wpa_single_include_general( $current, $stats) {
8 ?>
9 <div class="data_boxes">
10 <div class="data_boxes_title"><?php echo _e( 'General Statistics', 'wp-analytify'); ?> <div class="arrow_btn"></div></div>
11 <div class="data_container">
12 <div class="grids_auto_size">
13 <div class="grid_title">
14 SESSIONS
15 </div>
16 <div class="grid_data cen">
17 <div class="data_value"><?php echo number_format( $stats->totalsForAllResults['ga:sessions'] ); ?></div>
18 </div>
19 <div class="grid_footer cen">
20 Total number of Sessions within the date range. A session is the period time a user is actively engaged with your website, app, etc.
21 </div>
22 </div>
23 <div class="grids_auto_size">
24 <div class="grid_title">
25 USERS
26 </div>
27 <div class="grid_data cen">
28 <div class="data_value"><?php echo number_format($stats->totalsForAllResults['ga:users']); ?></div>
29 </div>
30 <div class="grid_footer cen">
31 Users that have had at least one session within the selected date range. Includes both new and returning users.
32 </div>
33 </div>
34 <div class="grids_auto_size">
35 <div class="grid_title"> BOUNCE RATE </div>
36 <div class="grid_data cen">
37 <div class="data_value">
38 <?php if ($stats->totalsForAllResults['ga:entrances'] <= 0) { ?>
39 0.00%
40 <?php
41 } //$stats->totalsForAllResults['ga:entrances'] <= 0
42 else {
43 echo number_format(round(($stats->totalsForAllResults['ga:bounces'] / $stats->totalsForAllResults['ga:entrances']) * 100, 2), 2);
44 ?>%
45 <?php } ?>
46 </div>
47 </div>
48 <div class="grid_footer cen">
49 Bounce Rate is the percentage of single-page visits (i.e. visits in which the person left your site from the entrance page without interacting with the page).
50 </div>
51 </div>
52 <div class="grids_auto_size">
53 <div class="grid_title"> AVG TIME ON THIS PAGE </div>
54 <div class="grid_data cen">
55 <div class="data_value">
56 <?php
57 if ($stats->totalsForAllResults['ga:sessions'] <= 0) {
58 ?>
59 00:00:00
60 <?php
61 } //$stats->totalsForAllResults['ga:sessions'] <= 0
62 else {
63 ?>
64 <?php
65 echo $current->pa_pretty_time($stats->totalsForAllResults['ga:avgSessionDuration']);
66 ?>
67 <?php } ?>
68 </div>
69 </div>
70 <div class="grid_footer cen"> <?php echo _e('The amount of time someone spends on this page.' , 'wp-analytify')?> </div>
71 </div>
72
73 <div class="grids_auto_size">
74 <div class="grid_title"> <?php echo _e('PAGE VIEWS', 'wp-analytify')?> </div>
75 <div class="grid_data cen">
76 <div class="data_value">
77
78 <?php
79 if ($stats->totalsForAllResults['ga:pageviews'] <= 0) {
80 echo '0';
81 }
82 else {
83 echo $current->wpa_number_format( $stats->totalsForAllResults['ga:pageviews']);
84 }
85 ?>
86
87 </div>
88 </div>
89 <div class="grid_footer cen">
90 <?php echo _e('Pageviews is the total number of pages viewed. Repeated views of a single page are counted.', 'wp-analytify');?>
91 </div>
92 </div>
93 <div class="grids_auto_size">
94 <div class="grid_title"> <?php echo _e( 'NEW/RETURNING VISITORS' , 'wp-analytify' ); ?> </div>
95 <div class="grid_data cen">
96 <div class="data_value">
97 <?php
98 if (isset($stats->totalsForAllResults))
99 {
100 if (!empty($stats["rows"])):
101 $returning = $stats->totalsForAllResults['ga:sessions'] - $stats->totalsForAllResults['ga:newUsers'];
102 ?>
103 <script type="text/javascript">
104
105 google.load("visualization", "1", {packages:["corechart"],'callback': drawChart});
106
107 function drawChart() {
108 var data = google.visualization.arrayToDataTable([
109 ['Visitors', 'Visitors Records'],
110 ['New Visitors',<?php echo $stats->totalsForAllResults['ga:newUsers']; ?>],
111 ['Return Visitors',<?php echo $returning; ?>],
112 ]);
113
114 var options = {
115 is3D: true,
116 legend:'none',
117 colors: ['#4fca74', '#0E9236']
118 };
119
120 var formatter = new google.visualization.NumberFormat({fractionDigits: 0});
121 formatter.format(data, 1);
122
123 var chart = new google.visualization.PieChart(document.getElementById('visitorschart'));
124 chart.draw(data, options);
125 }
126
127 </script>
128 <div id="visitorschart" style="width: 99%; height:150px;"></div>
129 <span class="visitor-stats-new"><span class="font-sizing"> New (<?php echo $current->wpa_number_format( $stats->totalsForAllResults['ga:newUsers']); ?>)</span> </span>
130 <span class="visitor-stats-ret"><span class="font-sizing"> Returning (<?php echo $current->wpa_number_format( $returning ); ?>)</span> </span>
131 <?php
132 endif;
133 }
134 ?>
135 </div>
136 </div>
137 </div>
138 </div>
139
140 <div class="data_boxes_footer">
141 <span class="blk">
142 <span class="dot"></span>
143 <span class="line"></span>
144 </span>
145 <span class="information-txt">
146 <?php echo _e('Did you know that total time spent on this page is ' , 'wp-analytify')?>
147 <?php
148 echo $current->pa_pretty_time($stats->totalsForAllResults['ga:sessionDuration']);
149 ?>
150 </span>
151 </div>
152 </div>
153
154 <?php } ?>