WD Google Analytics - Version 1.0.3

Version Description

Fixed: Front reports permissions
Fixed: Analytics menu
Fixed: Redirect to settings page if no profile added

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 WD Google Analytics
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

admin/gawd_google_class.php CHANGED
@@ -12,6 +12,7 @@ class GAWD_google_client {
12
  protected function __construct() {
13
  $this->gawd_user_data = get_option('gawd_user_data');
14
  try{
 
15
  $this->google_client = new Google_Client();
16
  $this->set_google_client();
17
  $this->analytics_member = new Google_Service_Analytics($this->google_client);
@@ -224,7 +225,7 @@ class GAWD_google_client {
224
  }
225
 
226
  /**
227
- * Get all the managment profiles of the authenticated user.
228
  *
229
  * @return array
230
  */
@@ -769,13 +770,23 @@ class GAWD_google_client {
769
  // for the last seven days.
770
 
771
  $filter_type = 'pagePath';
772
- $results = $analytics->data_ga->get(
773
- 'ga:' . $profileId, $start_date, $end_date, $metric, array(
774
- 'dimensions' => 'ga:' . $dimension,
775
- 'sort' => 'ga:' . $dimension,
776
- 'filters' => 'ga:' . $filter_type . '=~' . $filter
777
- )
778
- );
 
 
 
 
 
 
 
 
 
 
779
  $rows = $results->getRows();
780
  $metric = explode(',', $metric);
781
  if ($rows) {
@@ -1248,7 +1259,6 @@ class GAWD_google_client {
1248
  public function get_data_compact($metric, $dimension, $start_date, $end_date, $timezone) {
1249
  $profileId = $this->get_profile_id();
1250
  $metric_sort = $metric;
1251
- //var_dump($profileId);exit;
1252
  $analytics = $this->analytics_member;
1253
  // Get the results from the Core Reporting API and print the results.
1254
  // Calls the Core Reporting API and queries for the number of sessions
@@ -1348,12 +1358,12 @@ class GAWD_google_client {
1348
  $this->gawd_user_data['gawd_id'] = $first_profile['id'];
1349
  }
1350
  }
1351
- return $this->gawd_user_data['gawd_id'];
1352
  }
1353
 
1354
  public function get_profile_webPropertyId() {
1355
  $this->gawd_user_data = get_option('gawd_user_data');
1356
- return $this->gawd_user_data['webPropertyId'];
1357
  }
1358
 
1359
  public function get_profile_accountId() {
@@ -1363,12 +1373,12 @@ class GAWD_google_client {
1363
 
1364
  public function get_default_webPropertyId() {
1365
  $this->gawd_user_data = get_option('gawd_user_data');
1366
- return $this->gawd_user_data['default_webPropertyId'];
1367
  }
1368
 
1369
  public function get_default_accountId() {
1370
  $this->gawd_user_data = get_option('gawd_user_data');
1371
- return $this->gawd_user_data['default_accountId'];
1372
  }
1373
 
1374
  public function get_page_data($dimension, $start_date, $end_date, $timezone) {
12
  protected function __construct() {
13
  $this->gawd_user_data = get_option('gawd_user_data');
14
  try{
15
+
16
  $this->google_client = new Google_Client();
17
  $this->set_google_client();
18
  $this->analytics_member = new Google_Service_Analytics($this->google_client);
225
  }
226
 
227
  /**
228
+ * Get all the management profiles of the authenticated user.
229
  *
230
  * @return array
231
  */
770
  // for the last seven days.
771
 
772
  $filter_type = 'pagePath';
773
+
774
+ try {
775
+ $results = $analytics->data_ga->get(
776
+ 'ga:' . $profileId, $start_date, $end_date, $metric, array(
777
+ 'dimensions' => 'ga:' . $dimension,
778
+ 'sort' => 'ga:' . $dimension,
779
+ 'filters' => 'ga:' . $filter_type . '=~' . $filter
780
+ )
781
+ );
782
+ } catch (Exception $e) {
783
+ $error = array('error_message' => 'Error');
784
+ if (strpos($e->getMessage(), 'User does not have sufficient permissions for this profile')) {
785
+ $error['error_message'] = 'User does not have sufficient permissions for this profile';
786
+ }
787
+ return json_encode($error);
788
+ }
789
+
790
  $rows = $results->getRows();
791
  $metric = explode(',', $metric);
792
  if ($rows) {
1259
  public function get_data_compact($metric, $dimension, $start_date, $end_date, $timezone) {
1260
  $profileId = $this->get_profile_id();
1261
  $metric_sort = $metric;
 
1262
  $analytics = $this->analytics_member;
1263
  // Get the results from the Core Reporting API and print the results.
1264
  // Calls the Core Reporting API and queries for the number of sessions
1358
  $this->gawd_user_data['gawd_id'] = $first_profile['id'];
1359
  }
1360
  }
1361
+ return (isset($this->gawd_user_data['gawd_id'])?$this->gawd_user_data['gawd_id']:null);
1362
  }
1363
 
1364
  public function get_profile_webPropertyId() {
1365
  $this->gawd_user_data = get_option('gawd_user_data');
1366
+ return (isset($this->gawd_user_data['webPropertyId'])?$this->gawd_user_data['webPropertyId']:null);
1367
  }
1368
 
1369
  public function get_profile_accountId() {
1373
 
1374
  public function get_default_webPropertyId() {
1375
  $this->gawd_user_data = get_option('gawd_user_data');
1376
+ return (isset($this->gawd_user_data['default_webPropertyId'])?$this->gawd_user_data['default_webPropertyId']:null);
1377
  }
1378
 
1379
  public function get_default_accountId() {
1380
  $this->gawd_user_data = get_option('gawd_user_data');
1381
+ return (isset($this->gawd_user_data['default_accountId'])?$this->gawd_user_data['default_accountId']:null);
1382
  }
1383
 
1384
  public function get_page_data($dimension, $start_date, $end_date, $timezone) {
gawd_class.php CHANGED
@@ -21,12 +21,13 @@ class GAWD {
21
  if(isset($_POST["reset_data"]) && $_POST["reset_data"] != ''){
22
  $this->reset_user_data();
23
  }
24
- add_action('admin_enqueue_scripts', array($this, 'gawd_check_id'));
 
25
  add_action('admin_notices', array($this, 'upgrade_pro'));
26
 
27
- add_action('admin_menu', array($this, 'gawd_add_menu'));
28
  add_action('admin_enqueue_scripts', array($this, 'gawd_enqueue_scripts'));
29
- add_action('wp_enqueue_scripts', array($this, 'gawd_front_scripts'));
30
  add_action('wp_ajax_gawd_auth', array($this, 'gawd_auth'));
31
  add_action('wp_ajax_create_pdf_file', array($this, 'create_pdf_file'));
32
  add_action('wp_ajax_create_csv_file', array($this, 'create_csv_file'));
@@ -62,8 +63,12 @@ class GAWD {
62
  // Populate custom column in Pages List
63
  add_action('manage_pages_custom_column', array($this, 'gawd_add_icons'), 10, 2);
64
  add_action('add_meta_boxes', array($this, 'gawd_add_custom_box'));
65
- add_action('admin_bar_menu', array($this, 'report_adminbar'), 999);
66
  }
 
 
 
 
 
67
 
68
 
69
  $this->update_credentials();
@@ -81,14 +86,20 @@ class GAWD {
81
  }
82
 
83
  function get_current_user_role() {
84
- global $wp_roles;
85
- $current_user = wp_get_current_user();
86
- $roles = $current_user->roles;
87
- $role = array_shift($roles);
88
- return $role;
 
 
 
 
 
89
  }
90
 
91
- function report_adminbar($wp_admin_bar) {
 
92
  /* @formatter:off */
93
  $gawd_settings = get_option('gawd_settings');
94
  $gawd_frontend_roles = isset($gawd_settings['gawd_frontend_roles']) ? $gawd_settings['gawd_frontend_roles'] : array();
@@ -149,17 +160,17 @@ class GAWD {
149
  }
150
 
151
  function gawd_check_id() {
152
- global $gawd_user_data;
153
- $current_user = get_current_screen();
154
-
155
- if (strpos($current_user->base, 'gawd')) {
156
  $gawd_user_data = get_option('gawd_user_data');
157
  if (!isset($gawd_user_data['refresh_token']) || ($gawd_user_data['refresh_token'] == '')) {
158
- if (strpos($current_user->base, 'gawd_settings') === false && strpos($current_user->base, 'gawd_uninstall') === false) {
159
- wp_redirect(admin_url() . 'admin.php?page=gawd_settings');
160
- }
161
  }
162
  }
 
163
  }
164
 
165
  function gawd_add_custom_box() {
@@ -506,28 +517,30 @@ class GAWD {
506
  * Enqueues the required styles and scripts, localizes some js variables.
507
  */
508
  public function gawd_front_scripts() {
509
- wp_enqueue_style('admin_css', GAWD_URL . '/inc/css/gawd_admin.css', false, GAWD_VERSION);
510
- wp_enqueue_script('gawd_amcharts', GAWD_URL . '/inc/js/amcharts.js', false, GAWD_VERSION);
511
- wp_enqueue_script('gawd_pie', GAWD_URL . '/inc/js/pie.js', false, GAWD_VERSION);
512
- wp_enqueue_script('gawd_serial', GAWD_URL . '/inc/js/serial.js', false, GAWD_VERSION);
513
- wp_enqueue_script('gawd_light_theme', GAWD_URL . '/inc/js/light.js', array('jquery'), GAWD_VERSION);
514
- wp_enqueue_script('gawd_dataloader', GAWD_URL . '/inc/js/dataloader.min.js', array('jquery'), GAWD_VERSION);
515
- wp_enqueue_script('date-js', GAWD_URL . '/inc/js/date.js', array('jquery'), GAWD_VERSION);
516
- wp_enqueue_script('gawd_front_js', GAWD_URL . '/inc/js/gawd_front.js', array('jquery'), GAWD_VERSION);
517
- wp_localize_script('gawd_front_js', 'gawd_front', array(
518
- 'ajaxurl' => admin_url('admin-ajax.php'),
519
- 'ajaxnonce' => wp_create_nonce('gawd_admin_page_nonce'),
520
- 'gawd_plugin_url' => GAWD_URL,
521
- 'date_30' => date('Y-m-d',strtotime('-31 day')).'/-/'.date('Y-m-d',strtotime('-1 day')),
522
- 'date_7' => date('Y-m-d',strtotime('-8 day')).'/-/'.date('Y-m-d',strtotime('-1 day')),
523
- 'date_last_week' => date('Y-m-d',strtotime('last week -1day')).'/-/'.date('Y-m-d',strtotime('last week +5day')),
524
- 'date_last_month' => date('Y-m-01',strtotime('last month')).'/-/'.date('Y-m-t',strtotime('last month')),
525
- 'date_this_month' =>date('Y-m-01').'/-/'.date('Y-m-d'),
526
- 'date_today' => date('Y-m-d').'/-/'.date('Y-m-d'),
527
- 'date_yesterday' => date('Y-m-d',strtotime('-1 day')).'/-/'.date('Y-m-d',strtotime('-1 day')),
528
- 'wp_admin_url' => admin_url(),
529
- 'exportUrl' => add_query_arg(array('action' => 'gawd_export'), admin_url('admin-ajax.php'))
530
- ));
 
 
531
  }
532
 
533
  public function gawd_enqueue_scripts() {
@@ -612,6 +625,8 @@ class GAWD {
612
  * Adds the menu page with its submenus.
613
  */
614
  public function gawd_add_menu() {
 
 
615
  $gawd_settings = get_option('gawd_settings');
616
  $gawd_permissions = isset($gawd_settings['gawd_permissions']) ? $gawd_settings['gawd_permissions'] : array();
617
  if (empty($gawd_permissions)) {
@@ -634,8 +649,8 @@ class GAWD {
634
  __('Analytics', 'gawd'), //$page_title
635
  __('Analytics', 'gawd'), //$menu_title
636
  $permission, //$capability
637
- 'gawd_analytics', //$menu_slug
638
- array($this, 'gawd_display_overview_page'), //$function = '',
639
  GAWD_URL . '/assets/main_icon.png'
640
  //$position = null
641
  );
@@ -645,16 +660,16 @@ class GAWD {
645
  __('Overview', 'gawd'), //$page_title
646
  __('Overview', 'gawd'), //$menu_title
647
  $permission, //$capability
648
- 'gawd_analytics', //$menu_slug
649
- array($this, 'gawd_display_overview_page') //$function = '',
650
  );
651
  add_submenu_page(
652
  'gawd_analytics', //$parent_slug
653
  __('Reports', 'gawd'), //$page_title
654
  __('Reports', 'gawd'), //$menu_title
655
  $permission, //$capability
656
- 'gawd_reports', //$menu_slug
657
- array($this, 'gawd_display_reports_page') //$function = '',
658
  );
659
 
660
  add_submenu_page(
@@ -664,22 +679,23 @@ class GAWD {
664
  $permission, //$capability
665
  'gawd_settings', //$menu_slug
666
  array($this, 'gawd_display_settings_page') //$function = '',
 
667
  );
668
  add_submenu_page(
669
  'gawd_analytics', //$parent_slug
670
  __('Tracking', 'gawd'), //$page_title
671
  __('Tracking', 'gawd'), //$menu_title
672
  $permission, //$capability
673
- 'gawd_tracking', //$menu_slug
674
- array($this, 'gawd_display_tracking_page') //$function = '',
675
  );
676
  add_submenu_page(
677
  'gawd_analytics', //$parent_slug
678
  __('Goal Management', 'gawd'), //$page_title
679
  __('Goal Management', 'gawd'), //$menu_title
680
  $permission, //$capability
681
- 'gawd_goals', //$menu_slug
682
- array($this, 'gawd_display_goals_page') //$function = '',
683
  );
684
 
685
  add_submenu_page(
@@ -687,8 +703,8 @@ class GAWD {
687
  __('Custom Reports', 'gawd'), //$page_title
688
  __('Custom Reports', 'gawd'), //$menu_title
689
  $permission, //$capability
690
- 'gawd_custom_reports', //$menu_slug
691
- array($this, 'gawd_display_custom_reports_page') //$function = '',
692
  );
693
  add_submenu_page(
694
  'gawd_analytics', //$parent_slug
@@ -724,6 +740,26 @@ class GAWD {
724
  );
725
 
726
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
727
  public function gawd_display_licensing_page() {
728
  require_once(GAWD_DIR . '/admin/licensing.php');
729
  }
@@ -1175,6 +1211,7 @@ Alternatively, you can click <b>Later</b> and configure the web property any oth
1175
  }
1176
 
1177
  public function gawd_display_settings_page() {
 
1178
  global $gawd_user_data;
1179
  $gawd_user_data = get_option('gawd_user_data');
1180
  if(isset($_GET['defaultExist']) && $_GET['defaultExist'] ==1){
21
  if(isset($_POST["reset_data"]) && $_POST["reset_data"] != ''){
22
  $this->reset_user_data();
23
  }
24
+ add_action('admin_menu', array($this, 'gawd_check_id'), 1);
25
+
26
  add_action('admin_notices', array($this, 'upgrade_pro'));
27
 
28
+ add_action('admin_menu', array($this, 'gawd_add_menu'), 19);
29
  add_action('admin_enqueue_scripts', array($this, 'gawd_enqueue_scripts'));
30
+
31
  add_action('wp_ajax_gawd_auth', array($this, 'gawd_auth'));
32
  add_action('wp_ajax_create_pdf_file', array($this, 'create_pdf_file'));
33
  add_action('wp_ajax_create_csv_file', array($this, 'create_csv_file'));
63
  // Populate custom column in Pages List
64
  add_action('manage_pages_custom_column', array($this, 'gawd_add_icons'), 10, 2);
65
  add_action('add_meta_boxes', array($this, 'gawd_add_custom_box'));
 
66
  }
67
+ $gawd_frontend_roles = isset( $gawd_settings['gawd_frontend_roles'] ) ? $gawd_settings['gawd_frontend_roles'] : array();
68
+ if ( ( isset( $gawd_settings['gawd_tracking_enable'] ) && $gawd_settings['gawd_tracking_enable'] == 'on' ) && ( in_array( $roles, $gawd_frontend_roles ) || current_user_can( 'manage_options' ) ) ) {
69
+ add_action( 'wp_enqueue_scripts', array( $this, 'gawd_front_scripts' ) );
70
+ add_action( 'admin_bar_menu', array( $this, 'report_adminbar' ), 999 );
71
+ }
72
 
73
 
74
  $this->update_credentials();
86
  }
87
 
88
  function get_current_user_role() {
89
+ global $wp_roles;
90
+ if ( is_user_logged_in() ) {
91
+ $current_user = wp_get_current_user();
92
+ $roles = $current_user->roles;
93
+ $role = array_shift( $roles );
94
+
95
+ return $role;
96
+ } else {
97
+ return "";
98
+ }
99
  }
100
 
101
+
102
+ function report_adminbar($wp_admin_bar) {
103
  /* @formatter:off */
104
  $gawd_settings = get_option('gawd_settings');
105
  $gawd_frontend_roles = isset($gawd_settings['gawd_frontend_roles']) ? $gawd_settings['gawd_frontend_roles'] : array();
160
  }
161
 
162
  function gawd_check_id() {
163
+ global $gawd_redirect_to_settings;
164
+ $current_page = isset($_GET['page'])?$_GET['page']:"";
165
+ if (strpos($current_page, 'gawd')!==false) {
 
166
  $gawd_user_data = get_option('gawd_user_data');
167
  if (!isset($gawd_user_data['refresh_token']) || ($gawd_user_data['refresh_token'] == '')) {
168
+ update_option('gawd_redirect_to_settings', 'yes');
169
+ }else{
170
+ update_option('gawd_redirect_to_settings', 'no');
171
  }
172
  }
173
+ $gawd_redirect_to_settings = get_option('gawd_redirect_to_settings');
174
  }
175
 
176
  function gawd_add_custom_box() {
517
  * Enqueues the required styles and scripts, localizes some js variables.
518
  */
519
  public function gawd_front_scripts() {
520
+ if(is_user_logged_in()) {
521
+ wp_enqueue_style( 'admin_css', GAWD_URL . '/inc/css/gawd_admin.css', false, GAWD_VERSION );
522
+ wp_enqueue_script( 'gawd_amcharts', GAWD_URL . '/inc/js/amcharts.js', false, GAWD_VERSION );
523
+ wp_enqueue_script( 'gawd_pie', GAWD_URL . '/inc/js/pie.js', false, GAWD_VERSION );
524
+ wp_enqueue_script( 'gawd_serial', GAWD_URL . '/inc/js/serial.js', false, GAWD_VERSION );
525
+ wp_enqueue_script( 'gawd_light_theme', GAWD_URL . '/inc/js/light.js', array( 'jquery' ), GAWD_VERSION );
526
+ wp_enqueue_script( 'gawd_dataloader', GAWD_URL . '/inc/js/dataloader.min.js', array( 'jquery' ), GAWD_VERSION );
527
+ wp_enqueue_script( 'date-js', GAWD_URL . '/inc/js/date.js', array( 'jquery' ), GAWD_VERSION );
528
+ wp_enqueue_script( 'gawd_front_js', GAWD_URL . '/inc/js/gawd_front.js', array( 'jquery' ), GAWD_VERSION );
529
+ wp_localize_script( 'gawd_front_js', 'gawd_front', array(
530
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
531
+ 'ajaxnonce' => wp_create_nonce( 'gawd_admin_page_nonce' ),
532
+ 'gawd_plugin_url' => GAWD_URL,
533
+ 'date_30' => date( 'Y-m-d', strtotime( '-31 day' ) ) . '/-/' . date( 'Y-m-d', strtotime( '-1 day' ) ),
534
+ 'date_7' => date( 'Y-m-d', strtotime( '-8 day' ) ) . '/-/' . date( 'Y-m-d', strtotime( '-1 day' ) ),
535
+ 'date_last_week' => date( 'Y-m-d', strtotime( 'last week -1day' ) ) . '/-/' . date( 'Y-m-d', strtotime( 'last week +5day' ) ),
536
+ 'date_last_month' => date( 'Y-m-01', strtotime( 'last month' ) ) . '/-/' . date( 'Y-m-t', strtotime( 'last month' ) ),
537
+ 'date_this_month' => date( 'Y-m-01' ) . '/-/' . date( 'Y-m-d' ),
538
+ 'date_today' => date( 'Y-m-d' ) . '/-/' . date( 'Y-m-d' ),
539
+ 'date_yesterday' => date( 'Y-m-d', strtotime( '-1 day' ) ) . '/-/' . date( 'Y-m-d', strtotime( '-1 day' ) ),
540
+ 'wp_admin_url' => admin_url(),
541
+ 'exportUrl' => add_query_arg( array( 'action' => 'gawd_export' ), admin_url( 'admin-ajax.php' ) )
542
+ ) );
543
+ }
544
  }
545
 
546
  public function gawd_enqueue_scripts() {
625
  * Adds the menu page with its submenus.
626
  */
627
  public function gawd_add_menu() {
628
+
629
+
630
  $gawd_settings = get_option('gawd_settings');
631
  $gawd_permissions = isset($gawd_settings['gawd_permissions']) ? $gawd_settings['gawd_permissions'] : array();
632
  if (empty($gawd_permissions)) {
649
  __('Analytics', 'gawd'), //$page_title
650
  __('Analytics', 'gawd'), //$menu_title
651
  $permission, //$capability
652
+ 'gawd_analytics', //$menu_slug
653
+ array($this, $this->gawd_set_display('gawd_display_overview_page')), //$function = '',
654
  GAWD_URL . '/assets/main_icon.png'
655
  //$position = null
656
  );
660
  __('Overview', 'gawd'), //$page_title
661
  __('Overview', 'gawd'), //$menu_title
662
  $permission, //$capability
663
+ $this->gawd_set_slug('gawd_analytics'), //$menu_slug
664
+ array($this, $this->gawd_set_display('gawd_display_overview_page')) //$function = '',
665
  );
666
  add_submenu_page(
667
  'gawd_analytics', //$parent_slug
668
  __('Reports', 'gawd'), //$page_title
669
  __('Reports', 'gawd'), //$menu_title
670
  $permission, //$capability
671
+ $this->gawd_set_slug('gawd_reports'), //$menu_slug
672
+ array($this, $this->gawd_set_display('gawd_display_reports_page')) //$function = '',
673
  );
674
 
675
  add_submenu_page(
679
  $permission, //$capability
680
  'gawd_settings', //$menu_slug
681
  array($this, 'gawd_display_settings_page') //$function = '',
682
+
683
  );
684
  add_submenu_page(
685
  'gawd_analytics', //$parent_slug
686
  __('Tracking', 'gawd'), //$page_title
687
  __('Tracking', 'gawd'), //$menu_title
688
  $permission, //$capability
689
+ $this->gawd_set_slug('gawd_tracking'), //$menu_slug
690
+ array($this, $this->gawd_set_display('gawd_display_tracking_page')) //$function = '',
691
  );
692
  add_submenu_page(
693
  'gawd_analytics', //$parent_slug
694
  __('Goal Management', 'gawd'), //$page_title
695
  __('Goal Management', 'gawd'), //$menu_title
696
  $permission, //$capability
697
+ $this->gawd_set_slug('gawd_goals'), //$menu_slug
698
+ array($this, $this->gawd_set_display('gawd_display_goals_page')) //$function = '',
699
  );
700
 
701
  add_submenu_page(
703
  __('Custom Reports', 'gawd'), //$page_title
704
  __('Custom Reports', 'gawd'), //$menu_title
705
  $permission, //$capability
706
+ $this->gawd_set_slug('gawd_custom_reports'), //$menu_slug
707
+ array($this, $this->gawd_set_display('gawd_display_custom_reports_page')) //$function = '',
708
  );
709
  add_submenu_page(
710
  'gawd_analytics', //$parent_slug
740
  );
741
 
742
  }
743
+
744
+
745
+ public function gawd_set_slug($slug){
746
+ global $gawd_redirect_to_settings;
747
+ if($gawd_redirect_to_settings=='yes'){
748
+ return 'gawd_settings';
749
+ }else{
750
+ return $slug;
751
+ }
752
+ }
753
+
754
+ public function gawd_set_display($slug){
755
+ global $gawd_redirect_to_settings;
756
+ if($gawd_redirect_to_settings=='yes'){
757
+ return 'gawd_display_settings_page';
758
+ }else{
759
+ return $slug;
760
+ }
761
+ }
762
+
763
  public function gawd_display_licensing_page() {
764
  require_once(GAWD_DIR . '/admin/licensing.php');
765
  }
1211
  }
1212
 
1213
  public function gawd_display_settings_page() {
1214
+
1215
  global $gawd_user_data;
1216
  $gawd_user_data = get_option('gawd_user_data');
1217
  if(isset($_GET['defaultExist']) && $_GET['defaultExist'] ==1){
google-analytics-wd.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: WD Google Analytics
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-analytics-plugin.html
6
  * Description: WD Google Analytics is a user-friendly all in one plugin, which allows to manage and monitor your website analytics from WordPress dashboard.
7
- * Version: 1.0.2
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -26,7 +26,7 @@ if (!defined('GAWD_INC')) {
26
  }
27
 
28
  if (!defined('GAWD_VERSION')) {
29
- define('GAWD_VERSION', '1.0.2');
30
  }
31
 
32
  require_once( 'gawd_class.php' );
4
  * Plugin Name: WD Google Analytics
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-analytics-plugin.html
6
  * Description: WD Google Analytics is a user-friendly all in one plugin, which allows to manage and monitor your website analytics from WordPress dashboard.
7
+ * Version: 1.0.3
8
  * Author: WebDorado
9
  * Author URI: https://web-dorado.com
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
26
  }
27
 
28
  if (!defined('GAWD_VERSION')) {
29
+ define('GAWD_VERSION', '1.0.3');
30
  }
31
 
32
  require_once( 'gawd_class.php' );
inc/css/gawd_admin.css CHANGED
@@ -1,6 +1,3 @@
1
- body, html {
2
- background-color: #F1F1F1 !important;
3
- }
4
  #wpadminbar #wp-admin-bar-gawd>.ab-item:before{
5
  content: "\f185";
6
  top: 2px;
@@ -9,6 +6,7 @@ body, html {
9
  }
10
  #gawd_body{
11
  margin: 10px 0;
 
12
  }
13
  #gawd_body a{
14
  text-decoration: none;
 
 
 
1
  #wpadminbar #wp-admin-bar-gawd>.ab-item:before{
2
  content: "\f185";
3
  top: 2px;
6
  }
7
  #gawd_body{
8
  margin: 10px 0;
9
+ background-color: #F1F1F1 !important;
10
  }
11
  #gawd_body a{
12
  text-decoration: none;
include/gawd_pdf_file.php CHANGED
@@ -92,7 +92,7 @@ class gawd_pdf_file extends GAWD_file {
92
  // Output line
93
  $uplode_dir = wp_upload_dir();
94
  $image_dir = $uplode_dir['path'] . '/export_chart.png';
95
- var_dump($image_dir);
96
  imagejpeg($graph->Stroke(),$image_dir,100);
97
  return true;
98
  }
92
  // Output line
93
  $uplode_dir = wp_upload_dir();
94
  $image_dir = $uplode_dir['path'] . '/export_chart.png';
95
+ //var_dump($image_dir);
96
  imagejpeg($graph->Stroke(),$image_dir,100);
97
  return true;
98
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-google-analytics-plugin.h
4
  Tags: analytics, analytics dashboard, google analytics, google analytics dashboard, statistics, tracking, stats, ga, universal analytics, ecommerce tracking, custom dimensions, custom reports
5
  Requires at least: 3.9
6
  Tested up to: 4.6
7
- Stable tag: 1.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -14,25 +14,25 @@ Google Analytics WD is a user-friendly all in one plugin, which allows to manage
14
 
15
  [Google Analytics WD](https://web-dorado.com/products/wordpress-google-analytics-plugin.html)
16
  [Demo](http://wpdemo.web-dorado.com/wp-admin/admin.php?page=gawd_analytics)
17
- [User Manual](https://web-dorado.com/wordpress-google-analytics/installation.html)
18
-
19
- The plugin adds Google Analytics tracking code to your website, provides all the necessary options to easily customize the tracking code and to have best fit to your requirements. You can enable Anonymize IP address to mask the user IPs, or choose to track links with same destinations, buttons, menus and search boxes with “Enhanced Link Attribution”.
20
 
21
  After authenticating your Google Analytics, you can check the traffic of any site associated with your account. You can quickly and easily switch between different website reports.
22
 
23
  Use Overview page to select any date range and check the traffic of websites registered on your Google Analytics account. This section displays Real Time, Audience, Visitors, Location and Browsers reports.
24
 
25
- If you are looking for detailed and in-depth tracking reports, then Google Analytics WD is the plugin you need! Check your website Audience, Real Time statistics, Visitors Demographics, Interests and many more reports. You can easily compare data in reports from two different date ranges or by metrics.
26
 
27
- All these reports can be displayed in Line, Pie or Column charts. Moreover, they can be exported to CSV and PDF files, as well as sent as scheduled emails.
28
 
29
  Various settings of this WordPress plugin will let you place Google Analytics section on your admin dashboard, and reports - in posts and pages. You can enable Cross Domain tracking, set permissions for different roles or users to access Google Analytics WD reports and more.
30
 
31
  The outstanding functionality of this plugin allows to configure Google Analytics Filters with just a few easy steps. These options will let you exclude certain IP address, country, region or city from tracking. You can also set Goals based on Destinations, Durations and Pages/Screens per Session, using Goal Management function of the Google Analytics WD plugin.
32
 
33
- The mobile-friendly layout of Google Analytics WD WordPress plugin provides flawless experience on any device. You can check and configure tracking reports or settings anytime, anywhere.
34
 
35
- IMPORTANT: If you think you found a bug in the Google Analytics WD or have any problem or question concerning Google Analytics WD, do not hesitate to contact us at [info@web-dorado.com](mailto:info@web-dorado.com).
36
 
37
  Features of Google Analytics WD plugin:
38
 
@@ -98,6 +98,11 @@ Upgrade to Google Analytics WD Pro for premium features:
98
 
99
  == Changelog ==
100
 
 
 
 
 
 
101
  = 1.0.2 =
102
  Changed: Site speed and Sales performance reports sorting
103
 
@@ -137,3 +142,410 @@ After downloading the ZIP file of the Google Analytics WD plugin,
137
  4. Google Analytics WD - Technology - Operating Systems
138
  5. Google Analytics WD - Tracking Configuration
139
  6. Google Analytics WD - Location report
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  Tags: analytics, analytics dashboard, google analytics, google analytics dashboard, statistics, tracking, stats, ga, universal analytics, ecommerce tracking, custom dimensions, custom reports
5
  Requires at least: 3.9
6
  Tested up to: 4.6
7
+ Stable tag: 1.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
14
 
15
  [Google Analytics WD](https://web-dorado.com/products/wordpress-google-analytics-plugin.html)
16
  [Demo](http://wpdemo.web-dorado.com/wp-admin/admin.php?page=gawd_analytics)
17
+ [User Manual](https://web-dorado.com/wordpress-google-analytics/installation.html)
18
+
19
+ The plugin adds Google Analytics tracking code to your website, provides all the necessary options to easily customize the tracking code to best fit your requirements. You can enable Anonymize IP address to mask the user IPs, or choose to track links with same destinations, buttons, menus and search boxes with “Enhanced Link Attribution”.
20
 
21
  After authenticating your Google Analytics, you can check the traffic of any site associated with your account. You can quickly and easily switch between different website reports.
22
 
23
  Use Overview page to select any date range and check the traffic of websites registered on your Google Analytics account. This section displays Real Time, Audience, Visitors, Location and Browsers reports.
24
 
25
+ If you are looking for detailed and in-depth tracking reports, then this WordPress Google Analytics plugin is what you need. It allows checking your website Audience, Real Time statistics, Visitors Demographics, Interests and many more reports. You can easily compare data in reports from two different date ranges or by metrics.
26
 
27
+ All these reports can be displayed in Line, Pie or Column charts. Moreover, they can be exported to CSV and PDF files, as well as sent as scheduled emails.
28
 
29
  Various settings of this WordPress plugin will let you place Google Analytics section on your admin dashboard, and reports - in posts and pages. You can enable Cross Domain tracking, set permissions for different roles or users to access Google Analytics WD reports and more.
30
 
31
  The outstanding functionality of this plugin allows to configure Google Analytics Filters with just a few easy steps. These options will let you exclude certain IP address, country, region or city from tracking. You can also set Goals based on Destinations, Durations and Pages/Screens per Session, using Goal Management function of the Google Analytics WD plugin.
32
 
33
+ The mobile-friendly layout of the WordPress Google Analytics plugin provides flawless experience on any device. You can check and configure tracking reports or settings anytime, anywhere.
34
 
35
+ IMPORTANT: If you think you found a bug in the Google Analytics WD or have any problem or question concerning Google Analytics WD, do not hesitate to contact us at [support@web-dorado.com](mailto:support@web-dorado.com).
36
 
37
  Features of Google Analytics WD plugin:
38
 
98
 
99
  == Changelog ==
100
 
101
+ = 1.0.3 =
102
+ Fixed: Front reports permissions
103
+ Fixed: Analytics menu
104
+ Fixed: Redirect to settings page if no profile added
105
+
106
  = 1.0.2 =
107
  Changed: Site speed and Sales performance reports sorting
108
 
142
  4. Google Analytics WD - Technology - Operating Systems
143
  5. Google Analytics WD - Tracking Configuration
144
  6. Google Analytics WD - Location report
145
+
146
+
147
+
148
+
149
+
150
+
151
+ == User guide ==
152
+
153
+ Installation
154
+
155
+ Minimum requirements
156
+
157
+ WordPress 3.4+
158
+ PHP 5.x
159
+ MySQL 5.x
160
+
161
+ Installation of Google Analytics WD from WordPress Dashboard
162
+
163
+ Log in to WordPress administrative panel of your website.
164
+ Go to Plugins > Add New and click Upload Plugin button from the top.
165
+ Press Choose File button and select the downloaded .zip package of Google Analytics WD.
166
+ Click Install Now.
167
+
168
+ Installation with FTP connection
169
+
170
+ Connect to your website server using an FTP client software, e.g. FileZilla.
171
+ Open the directory containing the files of your WordPress site and navigate to /wp-content/plugins folder.
172
+ Unzip the plugin installation folder and upload it to /wp-content/plugins directory, without modifying files.
173
+ Login to administrative panel of your WordPress site and go to Plugins page.
174
+ Find Google Analytics WD and click Activate button.
175
+
176
+
177
+ Feel free to drop us an email (support@web-dorado.com) or post on Web-Dorado forum in case of facing problems.
178
+
179
+ Quick Start
180
+
181
+ Authentication
182
+
183
+ After activating Google Analytics WD, click on Analytics menu item, which will start Google Analytics account authorization process. Click Authenticate button and login to your Google account.
184
+
185
+ A window asking for relevant permissions will appear. Click Allow and copy the authentication code from the text input. You will be redirected to Google Analytics WD Tracking page.
186
+
187
+ Here you can add a web property on your Google Analytics account using current WordPress website. Provide a Name for the property and click Add. You can check and manage web properties from your Google Analytics account, Admin page.
188
+
189
+ Alternatively, you can click Later and configure the web property any other time.
190
+
191
+ You can Reauthenticate in Settings section anytime in case you need to use a different Google account to monitor Analytics tracking.
192
+
193
+
194
+ Overview
195
+
196
+ Click Analytics > Overview menu item. You will be taken to a page with quick reports: Real Time, Audience, Visitors, Browsers and Locations.
197
+
198
+ Make sure to select the date period for overview reports. You can monitor audience overview of any of sites registered to your Google Analytics account. Choose the website using tracking site select box.
199
+
200
+ Real Time. Indicates the number of users visiting your website just at that second.
201
+
202
+ Audience. Number of Sessions and Users within the specified period. Use Metrics to check Sessions, New Sessions, Users, Bounce Rates, Session Duration, Page/Session and Pageviews tracking. You can also compare reports of two different metrics.
203
+ Visitors. Draws a pie chart based on shares of New Visitors and Returning visitors of your website during the specified period.
204
+ Browsers. Analyzes the browser types used while interacting with your website (as shares).
205
+ Locations. A report based on user locations.
206
+
207
+ Full reports of Google Analytics are under Reports page of the plugin.
208
+
209
+
210
+ Reports
211
+ Global description
212
+
213
+ Keep track of the audience of any website of your Google Analytics account. Use the select box from the top to pick the tracking site.
214
+
215
+ Metrics
216
+
217
+ Metrics dropdown menus indicate Google Analytics metrics, based on which the report is being built.
218
+
219
+ Use the first select box only, in case you would like to view the information of one metric. You can also compare reports of two metrics. Select a value for the second dropdown to see the result.
220
+
221
+ Sessions. When users initialize activities on your website during a given time frame, the group of these interactions is considered as a session. It can contain pageviews, events, ecommerce transactions and social interactions.
222
+
223
+
224
+ New Sessions. Indicates the percentage of new users on your website, who have not visited your website before.
225
+
226
+ Users. Shows total number of users interacting with your website during selected time period.
227
+
228
+ Bounce Rate. The percentage of single page sessions, when the user left your website after visiting only one page.
229
+
230
+ Session Duration. Average duration of sessions, that took place on your site during the specified period.
231
+
232
+ Pageviews. The number of pages viewed during selected time frame.
233
+
234
+ Pages/Session. Indicates the average number of pages viewed during a session.
235
+
236
+ Charts
237
+
238
+ Line. Choose this option to view your website traffic with a line chart. Hover the chart points to check the values of each metric. These values are also displayed under the chart.
239
+
240
+ Pie. View your website traffic results within a pie chart by selecting this option. Values will be calculated as percentages.
241
+
242
+ Columns. This option builds a column chart based on selected Google Analytics tracking report of your website. Hover each column to check metrics results on specified dates.
243
+
244
+
245
+ Date range
246
+
247
+ Set the time period for your statistics chart using Date select box. Pick one of the predefined options:
248
+
249
+ Today
250
+ Yesterday
251
+ Last 7 Days
252
+ Last Week
253
+ Last 30 Days
254
+ This Month
255
+ Last Month
256
+
257
+ or set a Custom Range using two calendars of the toolbox. Click on a date to define the beginning of time frame, and choose the second date to set its ending.
258
+
259
+ Press Apply after selecting a date range, or Cancel to close the toolbox.
260
+
261
+ Select the scale of your Google Analytics report by clicking on Hour, Day, Week or Month buttons. The statistics graph will be changed correspondingly.
262
+
263
+
264
+ Compare Date
265
+
266
+ Metrics comparison lets you compare two metrics on a single graph, within a specified date range. Whereas Compare Date option measures tracking of one specified metric during two date periods. Click Compare Date button to open date picker.
267
+
268
+ Previous period. This option automatically sets the previous period of the time frame you selected for Date option. E.g. if you chose Last Week, Previous period option will be set to the week before.
269
+
270
+ Previous year. Compares the selected period report with the same period of the previous year.
271
+
272
+ Custom range. Use the calendars to set custom date range for comparison. You can measure statistics of any period with this option. For example, you can set the initial report date range from 22nd of February to 12th of March, 2015, and compare it to 4th to 26th of May, 2016.
273
+
274
+
275
+ Export and Email
276
+
277
+ You can export current report to CSV and PDF formats. Hover on Export button and click one of the options to download your report.
278
+
279
+ Moreover, the same report can be sent to one or more recipients which you specify. The mails can be sent one time, as well as periodically. Click the Email button to start the setup. A popup window will appear with the following options:
280
+
281
+ From. This is the email address, from which the report will be sent. It is the address you defined for your Administrator account, and it can be changed from WordPress Settings > General > Email Address option.
282
+
283
+ To. Determine the recipients of the report email by providing their email addresses separated by commas.
284
+
285
+ Subject. Write a subject for the email. It is set to the report title by default, but you can modify it and have a customized title.
286
+
287
+ Attachment. Pick the type of the attachment for your report. It can be sent as a CSV or a PDF file.
288
+
289
+ Frequency. Set the frequency for sending out report emails. The following options are available:
290
+
291
+ Once. The report is sent only one time.
292
+ Daily. The email is sent each day.
293
+ Weekly. Chose this option to send the report every week. Make sure to set the day of the week, when the email will be sent.
294
+ Monthly. Set the reports to be sent every month. Select the day of the month, when the email will be sent.
295
+
296
+ Additional Message. You can add any e-mail content to go along with your Google Analytics report.
297
+
298
+ The scheduled e-mails can be deleted from Settings > Emails page of Google Analytics WD plugin.
299
+
300
+
301
+ Report Types
302
+
303
+ Audience. Report of your website audience. Provides details about new and returning users of your website, sessions, bounces, pageviews, page/sessions and session durations.
304
+
305
+ Real Time. Shows the number of active users visiting your website pages at that second.
306
+
307
+ Demographics. Displays tracking statistics of your website users based on their age and gender.
308
+
309
+ Interests. Provides tracking information about site users depending on Affinity Categories (e.g. Music Lovers or Mobile Enthusiasts), In-Market Segments (based on online product purchase interests) and Other Categories (most specific identification, for example, tennis lovers among Sports Fans).
310
+
311
+ Geo. Geo-identifier report is built from interactions of location (countries, cities) and language of your website users.
312
+
313
+ Behavior. Compares number of New visitors and Returning users of your website in percents. You can check the duration of sessions with Engagement report.
314
+
315
+ Technology. Identifies tracking of the site based on operating systems and browsers visitors use.
316
+
317
+ Mobile. Shows statistics of mobile and desktop devices visitors have used while interacting with your website.
318
+
319
+ Custom Dimensions. Reports of Custom Dimensions you have added will be displayed under this tab. Step-by-step guide for the setup is in Custom Dimensions section of this guide.
320
+
321
+ Traffic Source. Displays overall graph of traffic sources directing to your website.
322
+
323
+ AdWords. If your website is registered on Google AdWords, you can link its Google Analytics to AdWords, and gather relevant tracking information with this report.
324
+
325
+ Pages. Pages report table will provide you information about Bounces, Entrances, Pageviews, Unique Pageviews, time spent on pages, Exits and Average page loading time.
326
+
327
+ Site Speed. Shows the average load time of your website during specified date range.
328
+
329
+ Events. Displays the report based on Events you set up on Google Analytics of your website. Graphs are built based on Event Labels, Categories and Actions.
330
+
331
+ Goals. Set Goals from Goal Management and review their Google Analytics reports under this tab. Instructions to set up goals will be provided in Goal Management section of this guide.
332
+
333
+ Ecommerce. Check sales statistics of your website by revenues, transactions, products and performance.
334
+
335
+ AdSense. Link your Google Analytics and AdSense accounts from Google Analytics Admin setting and keep track of AdSense tracking under this report.
336
+
337
+ Custom Reports. Add Custom Reports from any metric and dimension in Custom Reports page, and view relevant Google Analytics tracking information in this tab.
338
+
339
+ Settings
340
+ Authenticate
341
+
342
+ You can authenticate your Google Analytics account in this area. You will see a popup containing your Google accounts after clicking on Authenticate button. Select the account you’d like to connect with the plugin and permit Google Analytics WD to access your public profile. Then copy the authentication code and paste it in the input, which will appear under Authenticate button.
343
+
344
+ It is also possible to reauthenticate, in case an account is already connected to your Google Analytics WD plugin, and you would like to change it.
345
+
346
+
347
+ Use your own project
348
+
349
+ As an advanced functionality, you can provide Client ID key to use your own Google Analytics project. This lets Google Analytics WD plugin to send requests to your personal Google Oauth client to access Google Analytics API. You might need to use your own Oauth client in case of having to make a large number of requests to Google Analytics.
350
+
351
+ Mark Use your own project option as checked, this will activate Client ID and Client Secret settings of the plugin.
352
+
353
+ Visit console.developers.google.com to create your Google Analytics client ID. Navigate to Credentials, where you will see the following settings window:
354
+
355
+
356
+
357
+ Click Create Credentials button and select OAuth client ID from its dropdown list. Select Other option, write a title for your client ID and click Create as shown in the image below:
358
+
359
+
360
+
361
+ A popup will appear with new credentials:
362
+
363
+
364
+
365
+ Copy the client ID and client secret to corresponding options of Google Analytics WD plugin, then click Save.
366
+
367
+ Afterwards go back to Google API Manager and navigate to Overview. Click on Analytics API link.
368
+
369
+
370
+
371
+ The following settings will appear:
372
+
373
+
374
+
375
+ Click Enable button, and your project will be ready to use.
376
+
377
+ Alerts & Pushover
378
+
379
+ Alert and Pushover notifications will keep you posted about highest or lowest number of Sessions, Users, Bounces or Session Durations on your website.
380
+
381
+ The notifications can be sent daily, weekly or monthly, based on the conditions you select. Make sure to provide an email address, in case you are setting up Alerts, or your User Key, if you’d like the notifications to be sent via Pushover.
382
+
383
+ Pushover is an Android, iOS and Desktop application, which lets you set simple notifications on your smartphone or tablet. Download the application, create a user and copy the User Key of your account to Google Analytics WD settings. You will be receiving notifications accordingly.
384
+
385
+ Pushover for:
386
+ Android
387
+ iOS
388
+ Desktop
389
+
390
+ The following conditions can be set for Alert and Pushover Notifications:
391
+
392
+ When: Sessions, Users, Bounces or Session Durations
393
+ Condition: Is less than, Is greater than
394
+
395
+ For example, if would like to get notified, when to Users are less than 50, you need to select these options:
396
+
397
+ When: Users
398
+ Condition: Is less than
399
+ Value: 50
400
+
401
+ Filters
402
+
403
+ In case there are specific locations or IP addresses, which you would like to exclude from Google Analytics WD reports, you can use Filters feature of the plugin.
404
+
405
+ Write a Name for your filter and choose its Type, which can be one of the following:
406
+
407
+ Exclude Traffic From IP Address
408
+ Exclude Traffic From Country
409
+ Exclude Traffic From Region
410
+ Exclude Traffic From City
411
+
412
+ Each of these options have their text input for corresponding value. For example, if you select Exclude Traffic From IP Address, IP input field will appear, where you can provide the IP address, which you’d like to filter from your Google Analytics WD reports.
413
+
414
+ You can add several IP and location based exclusions, the list of which will be saved under Filters settings.
415
+
416
+ Emails
417
+
418
+ As you configure scheduled e-mails for each Google Analytics WD report, they appear in Email section of Settings page. You can check what type of reports are being sent, or delete them, if necessary.
419
+
420
+
421
+ Advanced
422
+
423
+ The group of settings under Advanced tab provides options to enlarge the basis of your reports, select user permissions and more:
424
+
425
+ Enable hover tooltips. Turn this option on to display help texts for Google Analytics WD options.
426
+
427
+ Enable AdSense link tracking. You can include your Google AdSense reports to Google Analytics WD reports page by turning this option on.
428
+
429
+ Enable reports on posts/pages (frontend and backend). Adds buttons to pages/posts list and site frontend, as well as under page/post metabox in editor. Clicking one will open a popup window containing comprehensive statistics of that specific page or post.
430
+
431
+ Exclude non-interaction events from bounce-rate calculation. If this setting is turned on, non-interaction events will be filtered when calculating bounce-rate. Watching a video, for example, is a non-interaction event, whereas posting a comment is interactive.
432
+ You can find out more about non-interaction events here.
433
+
434
+ Enable Cross Domain Tracking. You can let Google Analytics track similar activities on two related websites as a single session by turning Cross Domain Tracking on. Further information about Cross Domain tracking can be found within this link.
435
+
436
+ Provide Cross Domains separated by commas, making sure to use the following format:
437
+ http://example.com, http://yourdomain.com
438
+
439
+ Google Analytics tracks loading speed of your website to build a report based on site speed. Instead of evaluating all user activity for this purpose, it looks up among certain percentage of visiting users. You can determine this percentage with Site Speed SR (%) option.
440
+
441
+
442
+ User Permissions
443
+
444
+ You can choose the user groups, which have full access to Google Analytics WD plugin from WordPress administrative panel. Mark the necessary user types from Show plugin in backend for users setting.
445
+
446
+ Dashboard overview permissions allows to select all user roles, which will have access to view Google Analytics report on WordPress Dashboard.
447
+
448
+ Frontend report permissions allows you to permit displaying frontend reports of Google Analytics tracking to selected users.
449
+
450
+ Use Default Date option to have an initial value for date range on Reports page, Overview, as well as page, post and frontend statistics popups. It can be changed later with Date Range option.
451
+
452
+
453
+
454
+ AdSense and AdWords account linking
455
+
456
+ AdSense
457
+
458
+ If you have an authorized account on Google AdSense, you can link it to Google Analytics and view its tracking information among reports of Google Analytics WD plugin.
459
+
460
+ Open your Google Analytics account, choose the account you want to link with AdSense and navigate to Admin tab. You will see AdSense Linking option under Product Linking settings. Open AdSense Linking and click on New AdSense Link button.
461
+
462
+ Afterwards choose the necessary AdSense account you'd like to link with your Google Analytics, then click Continue. Choose the views of Google Analytics, where you would like to have AdSense data. The accounts will be connected after clicking Enable Link and then Done.
463
+
464
+
465
+ AdWords
466
+
467
+ Firstly make sure you have a Google AdWords account, or create one here. Open your Google Analytics account, choose the website you are tracking and go to Admin. Click on Adwords Linking from Product Linking settings.
468
+
469
+ After toolbox opens, make sure all the necessary AdWords accounts are marked as checked and click Continue. Provide Link group title and click Link Accounts after enabling necessary link groups for AdWords Tracking. Related tracking reports will appear on your Google Analytics WD Reports page automatically.
470
+
471
+ Tracking
472
+
473
+ Tracking
474
+
475
+ You can have full control over Tracking settings by enabling or disabling options of this tab. When Enable Tracking option is turned on, the plugin adds Google Analytics tracking code to your website. Note, that the code will be added in case your current website domain is associated with a Google Analytics account. The full demo script will appear on the right side of the page.
476
+
477
+ The following options are available among Tracking Settings:
478
+
479
+ Anonymize IP address. If this option is enabled, the last digits of users’ IP addresses will be hidden. Their full IP will not be visible, and thus the visitors will be anonymized.
480
+
481
+ Enhanced Link Attribution. Turn on this option to track multiple links with the same destination. Get information for buttons, menus, as well as elements with multiple destinations, e.g. search boxes. More information about Enhanced Link Attribution can be found here.
482
+
483
+ Outbound clicks tracking. Records the links which visitors have clicked to exit from your website.
484
+
485
+ Mailto, Download tracking file formats: .doc, .pdf, .xls, etc. Enable this option to track file downloads from your website and clicks on mailing links.
486
+
487
+ Custom Dimensions. If you have created custom dimensions, make sure to add the corresponding option to track related activity. The following options are available for custom dimension types:
488
+
489
+ Logged in
490
+ Post type
491
+ Author
492
+ Category
493
+ Published at
494
+ Tags
495
+
496
+ Click on Add button next to each custom dimension to start its tracking. Custom dimensions tracking can be enabled or disabled with these options any time.
497
+
498
+ Custom Dimensions
499
+
500
+ As the default dimensions provided by Google Analytics, there can also be Custom Dimensions, which you can configure yourself. They can be handy when you want to analyze specific data, which Google Analytics does not track automatically.
501
+
502
+ Google Analytics WD plugin provides six options for your WordPress sites, that can be used for creating Custom Dimensions.
503
+
504
+ For example, when you enable Logged in custom dimension, you can get tracking report particularly based on users, who are logged in to your website.
505
+
506
+ Furthermore, you can see the traffic of your website posts based on Post Types, Authors, Categories, Published at and Tags.
507
+
508
+ Using these custom dimensions you can check which one of your post authors is the favorite of your website visitors, for instance, or which category posts are read the most.
509
+
510
+
511
+ Exclude
512
+
513
+ You can set exclusions by user types and certain users with Exclude tracking by role and Exclude tracking for user. Select the user types and users, the activity of which you would like to exclude from Google Analytics tracking. Any interactions from these users will be ignored when evaluating reports.
514
+
515
+ Note, that these exclusions are set locally on your website, unlike Filters, which are connected to Google Analytics. In case these tracking exclusions are set and Google Analytics WD plugin detects the specified user or role, it does not include tracking script.
516
+
517
+ Whereas filters are added to your Google Analytics account, and traffic is excluded based on configurations described in Filters section.
518
+
519
+ Goal Management
520
+
521
+ Goals in Google Analytics lets you track targeted activities, which users complete on your website. A completed activity is called conversion. You can set visiting a certain page as a goal, for example, or have users stay on your website a certain period of time. Other examples of goals can be checkout for a shopping site, and setting a certain number of pageviews per session.
522
+
523
+ You can set and manage goals for your website tracking in Google Analytics WD > Goal Management page. Note, that Goals configured with Google Analytics WD are set only to the domain on which the plugin is installed.
524
+
525
+ Select the View that you’re going to track and configure the following options based on the type of goal you would like to set:
526
+
527
+ Provide a Name for the goal and choose its Type from one of the following:
528
+
529
+ Destination. Set a specific URL for the goal, for example, your ecommerce website shop page. When a user visits it, it will be counted as a goal conversion. You can set the destination using one of these conditions:
530
+ Equals to. Should be the exact URL of the page you are using to set the goal.
531
+ Begins with. Mentions the beginning of the tracked page link.
532
+ Regular expression. This option will search all the visited links with the specified Regular Expression. E.g., if you set it to \btest\b, and users visit URLs which contain “test”, this will be considered as a conversion.
533
+
534
+ Duration. Determine the time period, during which you need users to stay on your website to complete the goal. Goals of this type are controlled with less than and greater than conditions.
535
+
536
+ Pages/Screens per session. Choose the number of page/screen views per session, and set the goal using less than and greater than conditions.
537
+
538
+
539
+ Custom Reports
540
+
541
+ Besides the built-in report types, Google Analytics WD plugin also provides the functionality to configure Custom Reports and view related statistics within Reports page.
542
+
543
+ Start with providing a Name for your Custom Report. Then select a Metric and Dimension, based on which the statistics will be built.
544
+
545
+ For example, you can select Organic Searches as the metric and Keyword as the dimension. This custom setup will let you have a report based on the keywords, which visitors use to find your website with search engines.
546
+
547
+ You can view and manage created Custom Reports on the same page. The list will appear with a table under options of Custom Reports.
548
+
549
+
550
+
551
+