PluginProbe
Analytify – Google Analytics Dashboard For WordPress (GA4 analytics tracking) / trunk
Analytify – Google Analytics Dashboard For WordPress (GA4 analytics tracking) vtrunk
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 / default / admin / single-depth-stats.php

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

63 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * View of scroll depth statistics for single page.
4 *
5 * @package WP_Analytify
6 */
7
8 // Exit if accessed directly.
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; }
11
12 /**
13 * View of scroll depth statistics for single page.
14 *
15 * @param WP_Analytify $wp_analytify Main plugin instance.
16 * @param array<string, mixed> $stats Statistics data.
17 *
18 * @return void
19 */
20 function wpa_include_ga_single_depth( $wp_analytify, $stats ) {
21
22 $rows = $stats['rows'];
23 $total_visits = $stats['aggregations']['eventCount'];
24 ?>
25
26 <div class="analytify_general_status analytify_status_box_wraper">
27 <div class="analytify_status_header">
28 <h3><?php esc_html_e( 'Scroll Depth Reach', 'wp-analytify' ); ?></h3>
29 <div class="analytify_status_header_value keywords_total">
30 <span class="analytify_medium_f"><?php esc_html_e( 'Total Reach', 'wp-analytify' ); ?></span>
31 </div>
32 </div>
33
34 <table class="analytify_bar_tables">
35 <tbody>
36 <?php
37 if ( ! empty( $rows ) ) {
38 $total_visits = $stats['aggregations']['eventCount'];
39
40 foreach ( $rows as $row ) {
41 ?>
42 <tr>
43 <td>
44 <?php echo esc_html( $row['customEvent:link_label'] ) . '%'; ?>
45 <span class="analytify_bar_graph">
46 <span style="width: <?php echo esc_attr( ( $row['eventCount'] / $total_visits ) * 100 ); ?>%"></span>
47 </span>
48 </td>
49 <td class="analytify_txt_center analytify_value_row"><?php echo esc_html( WPANALYTIFY_Utils::pretty_numbers( $row['eventCount'] ) ); ?></td>
50 </tr>
51 <?php
52 }
53 } else {
54 echo wp_kses_post( method_exists( $wp_analytify, 'no_records' ) ? $wp_analytify->no_records() : '<p>' . esc_html__( 'No records found', 'wp-analytify' ) . '</p>' );
55 }
56 ?>
57 </tbody>
58 </table>
59 </div>
60
61 <?php
62 }
63