summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/stats.php')
-rw-r--r--plugins/jetpack/modules/stats.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/jetpack/modules/stats.php b/plugins/jetpack/modules/stats.php
index 4ea8339d..f36c3f44 100644
--- a/plugins/jetpack/modules/stats.php
+++ b/plugins/jetpack/modules/stats.php
@@ -280,7 +280,7 @@ function stats_admin_menu() {
}
}
- $hook = add_submenu_page( null, __( 'Site Stats', 'jetpack' ), __( 'Site Stats', 'jetpack' ), 'view_stats', 'stats', 'stats_reports_page' );
+ $hook = add_submenu_page( 'jetpack', __( 'Site Stats', 'jetpack' ), __( 'Site Stats', 'jetpack' ), 'view_stats', 'stats', 'stats_reports_page' );
add_action( "load-$hook", 'stats_reports_load' );
}
@@ -360,8 +360,6 @@ function stats_reports_page( $main_chart_only = false ) {
$blog_id = stats_get_option( 'blog_id' );
$domain = Jetpack::build_raw_urls( get_home_url() );
- JetpackTracking::record_user_event( 'wpa_page_view', array( 'path' => 'old_stats' ) );
-
if ( ! $main_chart_only && !isset( $_GET['noheader'] ) && empty( $_GET['nojs'] ) && empty( $_COOKIE['stnojs'] ) ) {
$nojs_url = add_query_arg( 'nojs', '1' );
$http = is_ssl() ? 'https' : 'http';
@@ -481,6 +479,11 @@ echo esc_url(
$body = stats_convert_admin_urls( $body );
echo $body;
}
+
+ if ( isset( $_GET['page'] ) && 'stats' === $_GET['page'] && ! isset( $_GET['chart'] ) ) {
+ JetpackTracking::record_user_event( 'wpa_page_view', array( 'path' => 'old_stats' ) );
+ }
+
if ( isset( $_GET['noheader'] ) )
die;
}