get_report( 'overview', $this->report_start_from, $this->report_end_to ); $data['percentage_of_mobile_visitors'] = isset( $report['data']['devices']['mobile'] ) ? $report['data']['devices']['mobile'] : 0; if ( ! empty( $data ) && $data['percentage_of_mobile_visitors'] < 10 ) { // Translators: Mobile device notification title $notification['title'] = sprintf( __( 'Traffic From Mobile Devices %s%%', 'google-analytics-for-wordpress' ), $data['percentage_of_mobile_visitors'] ); /* translators: Placeholders add a link to an article. */ $notification['content'] = sprintf( __( 'Traffic from mobile devices is considerably lower on your site compared to desktop devices. This could be an indicator that your site is not optimised for mobile devices.

Take a look now at %1$sshow your site looks%2$s on mobile and make sure all your content can be accessed correctly.', 'google-analytics-for-wordpress' ), '', '' ); $notification['btns'] = array( "view_report" => array( 'url' => $this->get_view_url( 'devices', 'monsterinsights_reports' ), 'text' => __( 'View Report', 'google-analytics-for-wordpress' ) ), "learn_more" => array( 'url' => $this->build_external_link( 'https://www.wpbeginner.com/beginners-guide/how-to-preview-the-mobile-layout-of-your-site/' ), 'text' => __( 'Learn More', 'google-analytics-for-wordpress' ), 'is_external' => true, ), ); return $notification; } return false; } } // initialize the class new MonsterInsights_Notification_Mobile_Device_Low_Traffic();