Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 2.2.1

Version Description

  • 24/09/2019 =
    • Compatibility with WooCommerce 3.7.0
    • Minor Bug Fixes
Download this release

Release Info

Developer Tatvic
Plugin Icon 128x128 Enhanced Ecommerce Google Analytics Plugin for WooCommerce
Version 2.2.1
Comparing to
See all releases

Code changes from version 2.2.0 to 2.2.1

admin/class-enhanced-ecommerce-google-analytics-admin.php CHANGED
@@ -22,140 +22,129 @@
22
  */
23
  class Enhanced_Ecommerce_Google_Analytics_Admin {
24
 
25
- /**
26
- * The ID of this plugin.
27
- *
28
- * @since 1.0.0
29
- * @access private
30
- * @var string $plugin_name The ID of this plugin.
31
- */
32
- private $plugin_name;
33
-
34
- /**
35
- * The version of this plugin.
36
- *
37
- * @since 1.0.0
38
- * @access private
39
- * @var string $version The current version of this plugin.
40
- */
41
- private $version;
42
-
43
- /**
44
- * Initialize the class and set its properties.
45
- *
46
- * @since 1.0.0
47
- * @param string $plugin_name The name of this plugin.
48
- * @param string $version The version of this plugin.
49
- */
50
- protected $ga_id;
51
-
52
- protected $ga_LC;
53
-
54
- protected $ga_eeT;
55
-
56
- public function __construct( $plugin_name, $version ) {
57
-
58
- $this->plugin_name = $plugin_name;
59
- $this->version = $version;
60
-
61
- }
62
-
63
- /**
64
- * Register the stylesheets for the admin area.
65
- *
66
- * @since 1.0.0
67
- */
68
- public function enqueue_styles() {
69
-
70
- $screen = get_current_screen();
71
- if ( $screen->id == 'tatvic-ee-plugin_page_enhanced-ecommerce-google-analytics-admin-display' ||(isset($_GET['page']) && $_GET['page'] == 'enhanced-ecommerce-google-analytics-admin-display')){
72
- wp_register_style('font_awesome','//use.fontawesome.com/releases/v5.0.13/css/all.css');
73
  wp_enqueue_style('font_awesome');
74
- wp_register_style('aga_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css');
75
- wp_enqueue_style('aga_bootstrap');
76
- wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/enhanced-ecommerce-google-analytics-admin.css', array(), $this->version, 'all' );
77
- }
78
-
79
-
80
- }
81
- /**
82
- * Register the JavaScript for the admin area.
83
- *
84
- * @since 1.0.0
85
- */
86
- public function enqueue_scripts() {
87
-
88
- $screen = get_current_screen();
89
- if ( $screen->id == 'tatvic-ee-plugin_page_enhanced-ecommerce-google-analytics-admin-display' ||(isset($_GET['page']) && $_GET['page'] == 'enhanced-ecommerce-google-analytics-admin-display')){
90
- wp_register_script('popper_bootstrap', '//cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js');
91
- wp_enqueue_script('popper_bootstrap');
92
- wp_register_script('aga_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js');
93
- wp_enqueue_script('aga_bootstrap');
94
- wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/enhanced-ecommerce-google-analytics-admin.js', array( 'jquery' ), $this->version, false );
95
- }
96
-
97
- }
98
-
99
- /**
100
- * Display Admin Page.
101
- *
102
- * @since 1.0.0
103
- */
104
- public function display_admin_page() {
105
- add_menu_page(
106
- 'Tatvic EE Plugin',
107
- 'Tatvic EE Plugin',
108
- 'manage_options',
109
- "enhanced-ecommerce-google-analytics-admin-display",
110
- array($this,'showPage'),
111
- plugin_dir_url(__FILE__) . 'images/tatvic_logo.png',
112
- 26
113
- );
114
-
115
- }
116
-
117
- /**
118
- * Display Tab page.
119
- *
120
- * @since 1.0.0
121
- */
122
- // public function add_new_menu(){
123
- // // add_submenu_page(__FILE__,
124
- // // "Enhanced Ecommerce Google Analytics for Woocommerce",
125
- // // "Enhanced Ecommerce Google Analytics for Woocommerce",
126
- // // "manage_options",
127
- // // "enhanced-ecommerce-google-analytics-admin-display",
128
- // // array($this,'showPage'),
129
- // // 99);
130
- // }
131
- public function showPage() {
132
- require_once( 'partials/enhanced-ecommerce-google-analytics-admin-display.php');
133
- if(!empty($_GET['tab'])){
134
- $get_action = $_GET['tab'];
135
- }
136
- else{
137
- $get_action = "general_settings";
138
- }
139
- if(method_exists($this, $get_action)) {
140
- $this->$get_action();
141
- }
142
-
143
- }
144
-
145
- public function general_settings() {
146
- require_once( 'partials/general-fields.php');
147
- }
148
-
149
- public function conversion_tracking() {
150
- require_once( 'partials/conversion-tracking.php');
151
- }
152
-
153
- public function google_optimize() {
154
- require_once( 'partials/google-optimize.php');
155
- }
156
-
157
- public function about_plugin() {
158
- require_once( 'partials/about-plugin.php');
159
- }
160
-
161
  }
22
  */
23
  class Enhanced_Ecommerce_Google_Analytics_Admin {
24
 
25
+ /**
26
+ * The ID of this plugin.
27
+ *
28
+ * @since 1.0.0
29
+ * @access private
30
+ * @var string $plugin_name The ID of this plugin.
31
+ */
32
+ private $plugin_name;
33
+
34
+ /**
35
+ * The version of this plugin.
36
+ *
37
+ * @since 1.0.0
38
+ * @access private
39
+ * @var string $version The current version of this plugin.
40
+ */
41
+ private $version;
42
+
43
+ /**
44
+ * Initialize the class and set its properties.
45
+ *
46
+ * @since 1.0.0
47
+ * @param string $plugin_name The name of this plugin.
48
+ * @param string $version The version of this plugin.
49
+ */
50
+ protected $ga_id;
51
+
52
+ protected $ga_LC;
53
+
54
+ protected $ga_eeT;
55
+
56
+ public function __construct( $plugin_name, $version ) {
57
+
58
+ $this->plugin_name = $plugin_name;
59
+ $this->version = $version;
60
+
61
+ }
62
+
63
+ /**
64
+ * Register the stylesheets for the admin area.
65
+ *
66
+ * @since 1.0.0
67
+ */
68
+ public function enqueue_styles() {
69
+
70
+ $screen = get_current_screen();
71
+ if ( $screen->id == 'toplevel_page_enhanced-ecommerce-google-analytics-admin-display' ||(isset($_GET['page']) && $_GET['page'] == 'enhanced-ecommerce-google-analytics-admin-display')){
72
+ wp_register_style('font_awesome','//use.fontawesome.com/releases/v5.0.13/css/all.css');
73
  wp_enqueue_style('font_awesome');
74
+ wp_register_style('aga_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css');
75
+ wp_enqueue_style('aga_bootstrap');
76
+ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/enhanced-ecommerce-google-analytics-admin.css', array(), $this->version, 'all' );
77
+ }
78
+
79
+
80
+ }
81
+ /**
82
+ * Register the JavaScript for the admin area.
83
+ *
84
+ * @since 1.0.0
85
+ */
86
+ public function enqueue_scripts() {
87
+
88
+ $screen = get_current_screen();
89
+ if ( $screen->id == 'toplevel_page_enhanced-ecommerce-google-analytics-admin-display' ||(isset($_GET['page']) && $_GET['page'] == 'enhanced-ecommerce-google-analytics-admin-display')){
90
+ wp_register_script('popper_bootstrap', '//cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js');
91
+ wp_enqueue_script('popper_bootstrap');
92
+ wp_register_script('aga_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js');
93
+ wp_enqueue_script('aga_bootstrap');
94
+ wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/enhanced-ecommerce-google-analytics-admin.js', array( 'jquery' ), $this->version, false );
95
+ }
96
+
97
+ }
98
+
99
+ /**
100
+ * Display Admin Page.
101
+ *
102
+ * @since 1.0.0
103
+ */
104
+ public function display_admin_page() {
105
+ add_menu_page(
106
+ 'Tatvic EE Plugin',
107
+ 'Tatvic EE Plugin',
108
+ 'manage_options',
109
+ "enhanced-ecommerce-google-analytics-admin-display",
110
+ array($this,'showPage'),
111
+ plugin_dir_url(__FILE__) . 'images/tatvic_logo.png',
112
+ 26
113
+ );
114
+
115
+ }
116
+
117
+ /**
118
+ * Display Tab page.
119
+ *
120
+ * @since 1.0.0
121
+ */
122
+ public function showPage() {
123
+ require_once( 'partials/enhanced-ecommerce-google-analytics-admin-display.php');
124
+ if(!empty($_GET['tab'])){
125
+ $get_action = $_GET['tab'];
126
+ }
127
+ else{
128
+ $get_action = "general_settings";
129
+ }
130
+ if(method_exists($this, $get_action)) {
131
+ $this->$get_action();
132
+ }
133
+ }
134
+
135
+ public function general_settings() {
136
+ require_once( 'partials/general-fields.php');
137
+ }
138
+
139
+ public function conversion_tracking() {
140
+ require_once( 'partials/conversion-tracking.php');
141
+ }
142
+
143
+ public function google_optimize() {
144
+ require_once( 'partials/google-optimize.php');
145
+ }
146
+
147
+ public function about_plugin() {
148
+ require_once( 'partials/about-plugin.php');
149
+ }
 
 
 
 
 
 
 
 
 
 
 
150
  }
admin/class-enhanced-ecommerce-google-analytics-settings.php CHANGED
@@ -20,58 +20,54 @@
20
  * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
21
  */
22
  if ( ! defined( 'ABSPATH' ) ) {
23
- exit();
24
  }
25
 
26
  class Enhanced_Ecommerce_Google_Settings {
27
-
28
- public static function add_update_settings($settings) {
29
- if ( !get_option($settings)) {
30
- $ee_options = array();
31
- if(is_array($_POST)) {
32
- foreach ($_POST as $key => $value) {
33
- if(!isset($_POST[$key])){
34
- $_POST[$key] = '';
35
- }
36
- if(isset($_POST[$key])) {
37
- $ee_options[$key] = $_POST[$key];
38
- }
39
- }
40
- }
41
- add_option( $settings, serialize( $ee_options ) );
42
- }
43
- else {
44
- $get_ee_settings = unserialize(get_option($settings));
45
- if(is_array($get_ee_settings)) {
46
- foreach ($get_ee_settings as $key => $value) {
47
- if(!isset($_POST[$key])){
48
- $_POST[$key] = '';
49
- }
50
- if( $_POST[$key] != $value ) {
51
- $get_ee_settings[$key] = $_POST[$key];
52
- }
53
-
54
- }
55
- }
56
- if(is_array($_POST)) {
57
- foreach($_POST as $key=>$value){
58
- if(!array_key_exists($key,$get_ee_settings)){
59
- $get_ee_settings[$key] = $value;
60
- }
61
- }
62
- }
63
- update_option($settings, serialize( $get_ee_settings ));
64
- }
65
- self::admin_notice__success();
66
- }
67
-
68
- private static function admin_notice__success() {
69
- $class = 'notice notice-success';
70
- $message = __( 'Your settings have been saved.', 'sample-text-domain' );
71
- printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) );
72
-
73
- }
74
-
75
- }
76
 
77
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
21
  */
22
  if ( ! defined( 'ABSPATH' ) ) {
23
+ exit();
24
  }
25
 
26
  class Enhanced_Ecommerce_Google_Settings {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
+ public static function add_update_settings($settings) {
29
+ if ( !get_option($settings)) {
30
+ $ee_options = array();
31
+ if(is_array($_POST)) {
32
+ foreach ($_POST as $key => $value) {
33
+ if(!isset($_POST[$key])){
34
+ $_POST[$key] = '';
35
+ }
36
+ if(isset($_POST[$key])) {
37
+ $ee_options[$key] = $_POST[$key];
38
+ }
39
+ }
40
+ }
41
+ add_option( $settings, serialize( $ee_options ) );
42
+ }
43
+ else {
44
+ $get_ee_settings = unserialize(get_option($settings));
45
+ if(is_array($get_ee_settings)) {
46
+ foreach ($get_ee_settings as $key => $value) {
47
+ if(!isset($_POST[$key])){
48
+ $_POST[$key] = '';
49
+ }
50
+ if( $_POST[$key] != $value ) {
51
+ $get_ee_settings[$key] = $_POST[$key];
52
+ }
53
+ }
54
+ }
55
+ if(is_array($_POST)) {
56
+ foreach($_POST as $key=>$value){
57
+ if(!array_key_exists($key,$get_ee_settings)){
58
+ $get_ee_settings[$key] = $value;
59
+ }
60
+ }
61
+ }
62
+ update_option($settings, serialize( $get_ee_settings ));
63
+ }
64
+ self::admin_notice__success();
65
+ }
66
+
67
+ private static function admin_notice__success() {
68
+ $class = 'notice notice-success';
69
+ $message = __( 'Your settings have been saved.', 'sample-text-domain' );
70
+ printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) );
71
+
72
+ }
73
+ }
admin/css/enhanced-ecommerce-google-analytics-admin.css CHANGED
@@ -11,37 +11,37 @@ body{
11
  background: #f1f1f1 !important;
12
  }
13
  .nav-link.active{
14
- color: #fff !important;
15
- background-color: #2D73C5 !important;
16
  }
17
  a.aga-tab{
18
- color:#4A4A4A !important;
19
- line-height: 2em;
20
  }
21
  .table td{
22
- vertical-align: middle !important;
23
  }
24
  td{
25
- width:8%;
26
  }
27
  .popover{
28
- max-width:500px !important;
29
  }
30
  .popover-body{
31
- text-align: justify;
32
- text-justify: inter-word;
33
  }
34
  input[type=text],input[type=email],input[type=number],textarea{
35
- border:1.3px solid #b4b9be;
36
  }
37
  input[type=checkbox]{
38
  border:1.2px solid #b4b9be;
39
  background:#fff;
40
- -webkit-transition: all 1.5s ease;
41
- -moz-transition: all 1.5s ease;
42
- -o-transition: all 1.5s ease;
43
- -ms-transition: all 1.5s ease;
44
- transition: all 1.5s ease;
45
  }
46
  input[type=checkbox]:checked::before {
47
  height:16px;
@@ -68,5 +68,4 @@ h5{
68
  margin-left: 6% !important;
69
  width:auto;
70
  }
71
-
72
  }
11
  background: #f1f1f1 !important;
12
  }
13
  .nav-link.active{
14
+ color: #fff !important;
15
+ background-color: #2D73C5 !important;
16
  }
17
  a.aga-tab{
18
+ color:#4A4A4A !important;
19
+ line-height: 2em;
20
  }
21
  .table td{
22
+ vertical-align: middle !important;
23
  }
24
  td{
25
+ width:8%;
26
  }
27
  .popover{
28
+ max-width:500px !important;
29
  }
30
  .popover-body{
31
+ text-align: justify;
32
+ text-justify: inter-word;
33
  }
34
  input[type=text],input[type=email],input[type=number],textarea{
35
+ border:1.3px solid #b4b9be;
36
  }
37
  input[type=checkbox]{
38
  border:1.2px solid #b4b9be;
39
  background:#fff;
40
+ -webkit-transition: all 1.5s ease;
41
+ -moz-transition: all 1.5s ease;
42
+ -o-transition: all 1.5s ease;
43
+ -ms-transition: all 1.5s ease;
44
+ transition: all 1.5s ease;
45
  }
46
  input[type=checkbox]:checked::before {
47
  height:16px;
68
  margin-left: 6% !important;
69
  width:auto;
70
  }
 
71
  }
admin/images/woo.png ADDED
Binary file
admin/images/woo_banner_adv.gif ADDED
Binary file
admin/partials/about-plugin.php CHANGED
@@ -1,164 +1,164 @@
1
  <style>
2
- td{
3
- text-align: center !important;
4
- }
5
- th{
6
- text-align: center !important;
7
- }
8
- .fa-times{
9
- color:red;
10
- }
11
- .fa-check{
12
- color:green;
13
- }
14
  </style>
15
  <div class="container">
16
- <div class="row" style="margin-left:-11%; !important;">
17
- <div class= "col col-9">
18
- <div class="card mw-100" style="padding:0;">
19
- <div class="card-header">
20
- <h5>Feature difference between <span style="font-weight: 800;">Free & Premium</span> Plugin</h5>
21
- </div>
22
- <div class="card-body">
23
- <div class="row">
24
- <div class="col-md-10 my-4 mx-auto">
25
- <div class="row">
26
- <div class="col-lg-12">
27
- <div class="table-responsve">
28
- <table class="table table-striped table-hover">
29
- <thead class="thead-inverse">
30
- <tr>
31
- <th class="w-25" style="font-weight: 900;">Features</th>
32
- <th class="" style="font-weight: 900;">Free</th>
33
- <th class="" style="font-weight: 900;">Premium</th>
34
- </tr>
35
- </thead>
36
- <tbody>
37
- <tr>
38
- <td class="w-25 option">Basic UA Tracking (Pageviews)</td>
39
- <td><i class="fa fa-check"></i></td>
40
- <td><i class="fa fa-check"></i></td>
41
- </tr>
42
- <tr>
43
- <td class="option">Enhanced Ecommerce</td>
44
- <td><strong>Only 4 Reports</strong></td>
45
- <td><strong>All reports</strong></td>
46
- </tr>
47
- <tr>
48
- <td class="option">I.P. Anonymization</td>
49
- <td><i class="fa fa-check"></i></td>
50
- <td><i class="fa fa-check"></i></td>
51
- </tr>
52
- <tr>
53
- <td class="option">Google Opt-Out</td>
54
- <td><i class="fa fa-check"></i></td>
55
- <td><i class="fa fa-check"></i></td>
56
- </tr>
57
- <tr>
58
- <td class="option">Product List Performance</td>
59
- <td><i class="fa fa-times"></i></td>
60
- <td><i class="fa fa-check"></i></td>
61
- </tr>
62
- <tr>
63
- <td class="option">Display Feature</td>
64
- <td><i class="fa fa-times"></i></td>
65
- <td><i class="fa fa-check"></i></td>
66
- </tr>
67
- <tr>
68
- <td class="option">Product Variations (eg. color,size)</td>
69
- <td><i class="fa fa-times"></i></td>
70
- <td><i class="fa fa-check"></i></td>
71
- </tr>
72
- <tr>
73
- <td class="option">Automated Product Refund (from Admin Panel)</td>
74
- <td><i class="fa fa-times"></i></td>
75
- <td><i class="fa fa-check"></i></td>
76
- </tr>
77
- <tr>
78
- <td class="option">Google Adwords Conversion Tracking</td>
79
- <td><i class="fa fa-times"></i></td>
80
- <td><i class="fa fa-check"></i></td>
81
- </tr>
82
- <tr>
83
- <td class="option">Facebook Pixel Implementation (Standard Ecommerce Events)</td>
84
- <td><i class="fa fa-times"></i></td>
85
- <td><i class="fa fa-check"></i></td>
86
- </tr>
87
- <tr>
88
- <td class="option">Add Google Optimize Snippet</td>
89
- <td><i class="fa fa-times"></i></td>
90
- <td><i class="fa fa-check"></i></td>
91
- </tr>
92
- <tr>
93
- <td class="option">Site Speed Sample Rate</td>
94
- <td><i class="fa fa-times"></i></td>
95
- <td><i class="fa fa-check"></i></td>
96
- </tr>
97
- <tr>
98
- <td class="option">User ID Tracking</td>
99
- <td><i class="fa fa-times"></i></td>
100
- <td><i class="fa fa-check"></i></td>
101
- </tr>
102
- <tr>
103
- <td class="option">Form Field Tracking</td>
104
- <td><i class="fa fa-times"></i></td>
105
- <td><i class="fa fa-check"></i></td>
106
- </tr>
107
- <tr>
108
- <td class="option">Content Grouping</td>
109
- <td><i class="fa fa-times"></i></td>
110
- <td><i class="fa fa-check"></i></td>
111
- </tr>
112
-
113
- <tr>
114
- <td class="option">Internal Promotion</td>
115
- <td><i class="fa fa-times"></i></td>
116
- <td><i class="fa fa-check"></i></td>
117
- </tr>
118
- <tr>
119
- <td class="option">15+ Ready to Use Custom Dimensions/ Metrics</td>
120
- <td><i class="fa fa-times"></i></td>
121
- <td><i class="fa fa-check"></i></td>
122
- </tr>
123
- <tr>
124
- <td class="option">Child / Custom Theme Support</td>
125
- <td><i class="fa fa-times"></i></td>
126
- <td><i class="fa fa-check"></i></td>
127
- </tr>
128
- <tr>
129
- <td class="option">Quick Expert Support ( Query Support)</td>
130
- <td><i class="fa fa-times"></i></td>
131
- <td><i class="fa fa-check"></i></td>
132
- </tr>
133
- <tr>
134
- <td class="option">Paid Customization (As per the requirement)</td>
135
- <td><i class="fa fa-times"></i></td>
136
- <td><i class="fa fa-check"></i></td>
137
- </tr>
138
- <tr>
139
- <td class="option">Data Studio Dashboards (Paid)</td>
140
- <td><i class="fa fa-times"></i></td>
141
- <td><i class="fa fa-check"></i></td>
142
- </tr>
143
- </tbody>
144
- <tfoot class="thead-inverse">
145
- <tr>
146
- <th class="w-25"></th>
147
- <th class=""></th>
148
- <th class=""><a href="https://1.envato.market/Yvn3R" target="_blank"><button class="btn btn-primary"><strong>Buy Premium Plugin</strong></button></a></th>
149
- </tr>
150
- </tfoot>
151
- </table>
152
- <p class="description" style="font-size: 15px;"><strong>Feel free to contact us regarding premium version inquiry at <span style="color:blue;font-size:15px;">analytics2@tatvic.com<span></strong>.<br/>Agencies & Marketers can also contact us for the bulk licenses for their clients.</p>
153
- </div>
154
- </div>
155
- </div>
156
- </div>
157
- </div>
158
- <hr>
159
- </div>
160
- </div>
161
- </div>
162
- <?php require_once('sidebar.php');?>
163
- </div>
164
  </div>
1
  <style>
2
+ td{
3
+ text-align: center !important;
4
+ }
5
+ th{
6
+ text-align: center !important;
7
+ }
8
+ .fa-times{
9
+ color:red;
10
+ }
11
+ .fa-check{
12
+ color:green;
13
+ }
14
  </style>
15
  <div class="container">
16
+ <div class="row" style="margin-left:-11%; !important;">
17
+ <div class= "col col-9">
18
+ <div class="card mw-100" style="padding:0;">
19
+ <div class="card-header">
20
+ <h5>Feature difference between <span style="font-weight: 800;">Free & Premium</span> Plugin</h5>
21
+ </div>
22
+ <div class="card-body">
23
+ <div class="row">
24
+ <div class="col-md-10 my-4 mx-auto">
25
+ <div class="row">
26
+ <div class="col-lg-12">
27
+ <div class="table-responsve">
28
+ <table class="table table-striped table-hover">
29
+ <thead class="thead-inverse">
30
+ <tr>
31
+ <th class="w-25" style="font-weight: 900;">Features</th>
32
+ <th class="" style="font-weight: 900;">Free</th>
33
+ <th class="" style="font-weight: 900;">Premium</th>
34
+ </tr>
35
+ </thead>
36
+ <tbody>
37
+ <tr>
38
+ <td class="w-25 option">Basic UA Tracking (Pageviews)</td>
39
+ <td><i class="fa fa-check"></i></td>
40
+ <td><i class="fa fa-check"></i></td>
41
+ </tr>
42
+ <tr>
43
+ <td class="option">Enhanced Ecommerce</td>
44
+ <td><strong>Only 4 Reports</strong></td>
45
+ <td><strong>All reports</strong></td>
46
+ </tr>
47
+ <tr>
48
+ <td class="option">I.P. Anonymization</td>
49
+ <td><i class="fa fa-check"></i></td>
50
+ <td><i class="fa fa-check"></i></td>
51
+ </tr>
52
+ <tr>
53
+ <td class="option">Google Opt-Out</td>
54
+ <td><i class="fa fa-check"></i></td>
55
+ <td><i class="fa fa-check"></i></td>
56
+ </tr>
57
+ <tr>
58
+ <td class="option">Product List Performance</td>
59
+ <td><i class="fa fa-times"></i></td>
60
+ <td><i class="fa fa-check"></i></td>
61
+ </tr>
62
+ <tr>
63
+ <td class="option">Display Feature</td>
64
+ <td><i class="fa fa-times"></i></td>
65
+ <td><i class="fa fa-check"></i></td>
66
+ </tr>
67
+ <tr>
68
+ <td class="option">Product Variations (eg. color,size)</td>
69
+ <td><i class="fa fa-times"></i></td>
70
+ <td><i class="fa fa-check"></i></td>
71
+ </tr>
72
+ <tr>
73
+ <td class="option">Automated Product Refund (from Admin Panel)</td>
74
+ <td><i class="fa fa-times"></i></td>
75
+ <td><i class="fa fa-check"></i></td>
76
+ </tr>
77
+ <tr>
78
+ <td class="option">Google Adwords Conversion Tracking</td>
79
+ <td><i class="fa fa-times"></i></td>
80
+ <td><i class="fa fa-check"></i></td>
81
+ </tr>
82
+ <tr>
83
+ <td class="option">Facebook Pixel Implementation (Standard Ecommerce Events)</td>
84
+ <td><i class="fa fa-times"></i></td>
85
+ <td><i class="fa fa-check"></i></td>
86
+ </tr>
87
+ <tr>
88
+ <td class="option">Add Google Optimize Snippet</td>
89
+ <td><i class="fa fa-times"></i></td>
90
+ <td><i class="fa fa-check"></i></td>
91
+ </tr>
92
+ <tr>
93
+ <td class="option">Site Speed Sample Rate</td>
94
+ <td><i class="fa fa-times"></i></td>
95
+ <td><i class="fa fa-check"></i></td>
96
+ </tr>
97
+ <tr>
98
+ <td class="option">User ID Tracking</td>
99
+ <td><i class="fa fa-times"></i></td>
100
+ <td><i class="fa fa-check"></i></td>
101
+ </tr>
102
+ <tr>
103
+ <td class="option">Form Field Tracking</td>
104
+ <td><i class="fa fa-times"></i></td>
105
+ <td><i class="fa fa-check"></i></td>
106
+ </tr>
107
+ <tr>
108
+ <td class="option">Content Grouping</td>
109
+ <td><i class="fa fa-times"></i></td>
110
+ <td><i class="fa fa-check"></i></td>
111
+ </tr>
112
+
113
+ <tr>
114
+ <td class="option">Internal Promotion</td>
115
+ <td><i class="fa fa-times"></i></td>
116
+ <td><i class="fa fa-check"></i></td>
117
+ </tr>
118
+ <tr>
119
+ <td class="option">15+ Ready to Use Custom Dimensions/ Metrics</td>
120
+ <td><i class="fa fa-times"></i></td>
121
+ <td><i class="fa fa-check"></i></td>
122
+ </tr>
123
+ <tr>
124
+ <td class="option">Child / Custom Theme Support</td>
125
+ <td><i class="fa fa-times"></i></td>
126
+ <td><i class="fa fa-check"></i></td>
127
+ </tr>
128
+ <tr>
129
+ <td class="option">Quick Expert Support ( Query Support)</td>
130
+ <td><i class="fa fa-times"></i></td>
131
+ <td><i class="fa fa-check"></i></td>
132
+ </tr>
133
+ <tr>
134
+ <td class="option">Paid Customization (As per the requirement)</td>
135
+ <td><i class="fa fa-times"></i></td>
136
+ <td><i class="fa fa-check"></i></td>
137
+ </tr>
138
+ <tr>
139
+ <td class="option">Data Studio Dashboards (Paid)</td>
140
+ <td><i class="fa fa-times"></i></td>
141
+ <td><i class="fa fa-check"></i></td>
142
+ </tr>
143
+ </tbody>
144
+ <tfoot class="thead-inverse">
145
+ <tr>
146
+ <th class="w-25"></th>
147
+ <th class=""></th>
148
+ <th class=""><a href="https://1.envato.market/Yvn3R" target="_blank"><button class="btn btn-primary"><strong>Buy Premium Plugin</strong></button></a></th>
149
+ </tr>
150
+ </tfoot>
151
+ </table>
152
+ <p class="description" style="font-size: 15px;"><strong>Feel free to contact us regarding premium version inquiry at <span style="color:blue;font-size:15px;">analytics2@tatvic.com<span></strong>.<br/>Agencies & Marketers can also contact us for the bulk licenses for their clients.</p>
153
+ </div>
154
+ </div>
155
+ </div>
156
+ </div>
157
+ </div>
158
+ <hr>
159
+ </div>
160
+ </div>
161
+ </div>
162
+ <?php require_once('sidebar.php');?>
163
+ </div>
164
  </div>
admin/partials/enhanced-ecommerce-google-analytics-admin-display.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Provide a admin area view for the plugin
5
  *
@@ -16,31 +15,30 @@ if (!defined('ABSPATH')) {
16
  exit;
17
  }
18
 
19
- $site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
20
-
21
- if(isset($_GET['tab']) && $_GET['tab'] == 'general_settings'){
22
- $general_class_active = "active";
23
- }
24
- else{
25
- $general_class_active = "";
26
- }
27
- if(isset($_GET['tab']) && $_GET['tab'] == 'about_plugin'){
28
- $advanced_class_active = "active";
29
- }
30
- else{
31
- $advanced_class_active = "";
32
- }
33
- if(empty($_GET['tab'])){
34
- $general_class_active = "active";
35
- }
36
-
37
  ?>
38
  <header class='background-color:#E8E8E8;height:500px;width:auto;margin-top:100px;margin-left:20px;'>
39
- <img class ="banner" src='<?php echo plugins_url('../images/banner.png', __FILE__ ) ?>' style="margin-left:10px;">
40
  </header>
41
- <ul class="nav nav-tabs nav-pills" style="margin-left: 10px;margin-top:20px;">
42
- <li class="nav-item">
43
- <a href="<?php echo $site_url.'general_settings'; ?>" class="border-left aga-tab nav-link <?php echo $general_class_active; ?>">General Setting</a>
44
- </li>
45
- <li class="nav-item"><a href="<?php echo $site_url.'about_plugin'; ?>" class="border-left aga-tab nav-link <?php echo $advanced_class_active; ?>">Premium Plugin</a></li>
46
- </ul>
1
  <?php
 
2
  /**
3
  * Provide a admin area view for the plugin
4
  *
15
  exit;
16
  }
17
 
18
+ $site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
19
+
20
+ if(isset($_GET['tab']) && $_GET['tab'] == 'general_settings'){
21
+ $general_class_active = "active";
22
+ }
23
+ else{
24
+ $general_class_active = "";
25
+ }
26
+ if(isset($_GET['tab']) && $_GET['tab'] == 'about_plugin'){
27
+ $advanced_class_active = "active";
28
+ }
29
+ else{
30
+ $advanced_class_active = "";
31
+ }
32
+ if(empty($_GET['tab'])){
33
+ $general_class_active = "active";
34
+ }
 
35
  ?>
36
  <header class='background-color:#E8E8E8;height:500px;width:auto;margin-top:100px;margin-left:20px;'>
37
+ <img class ="banner" src='<?php echo plugins_url('../images/banner.png', __FILE__ ) ?>' style="margin-left:10px;">
38
  </header>
39
+ <ul class="nav nav-tabs nav-pills" style="margin-left: 10px;margin-top:20px;">
40
+ <li class="nav-item">
41
+ <a href="<?php echo $site_url.'general_settings'; ?>" class="border-left aga-tab nav-link <?php echo $general_class_active; ?>">General Setting</a>
42
+ </li>
43
+ <li class="nav-item"><a href="<?php echo $site_url.'about_plugin'; ?>" class="border-left aga-tab nav-link <?php echo $advanced_class_active; ?>">Premium Plugin</a></li>
44
+ </ul>
admin/partials/general-fields.php CHANGED
@@ -1,113 +1,113 @@
1
  <?php
2
  if(isset($_POST['ee_submit_plugin'])){
3
- Enhanced_Ecommerce_Google_Settings::add_update_settings('ee_options');
4
  }
5
  $data = unserialize(get_option('ee_options'));
6
  ?>
7
  <div class="container">
8
- <div class="row" style="margin-left:-11%; !important;">
9
- <div class= "col col-9" >
10
- <div class="card mw-100" style="padding:0px;">
11
- <div class="card-header">
12
- <h5>Enhanced Ecommerce Google Analytics</h5>
13
- </div>
14
- <div class="card-body">
15
- <form id="ee_plugin_form" method="post" action="" enctype="multipart/form-data" >
16
- <table class="table table-bordered">
17
- <tbody>
18
 
19
- <tr>
20
- <td>
21
- <label class="align-middle" for="woocommerce_ee_google_analytics_ga_id">Google Analytics ID</label>
22
- </td>
23
- <td>
24
- <input type="text" id="ga_id" name = "ga_id" required = "required" value="<?php echo $data['ga_id'];?>">
25
- <i style="cursor: help;" class="fas fa-question-circle" title="Enter your Google Analytics ID here. You can login into your Google Analytics account to find your ID. e.g. UA-XXXXXX-XX"></i>
26
- </td>
27
- </tr>
28
- <tr>
29
- <td>
30
- <label class="align-middle" for="tracking_code">Tracking Code</label>
31
- </td>
32
- <td>
33
- <label class = "align-middle" for="ga_code">
34
- <?php $ga_ST = !empty($data['ga_ST'])? 'checked' : ''; ?>
35
- <input type="checkbox" name="ga_ST" id="ga_ST" <?php echo $ga_ST; ?> >
36
- Add Global Site Tracking Code 'gtag.js'
37
- <p class="description">This feature adds New gtag.js Tracking Code to your Store. You don't need to enable this if gtag.js implemented via a 3rd party analytics plugin.</p>
38
- </label><br/>
39
- <label class = "align-middle" for="ga_enhance_ecommerce">
40
- <?php $ga_eeT = !empty($data['ga_eeT'])? 'checked' : ''; ?>
41
- <input type="checkbox" name="ga_eeT" id="ga_eeT" <?php echo $ga_eeT; ?> >
42
- Add Enhanced Ecommerce Tracking Code
43
- <p class="description">This feature adds Enhanced Ecommerce Tracking Code to your Store</p>
44
- </label><br/>
45
- <label class = "align-middle" for="ga_login_step">
46
- <?php $ga_gUser = !empty($data['ga_gUser'])? 'checked' : ''; ?>
47
- <input type="checkbox" name="ga_gUser" id="ga_gUser" <?php echo $ga_gUser; ?> >
48
- Add Code to Track the Login Step of Guest Users (Optional)
49
- <p class="description">If you have Guest Check out enable, we recommend you to add this code</p>
50
- </label><br/>
51
- </td>
52
- </tr>
53
- <tr>
54
- <td>
55
- <label for="ga_Impr">Impression Thresold</label>
56
- </td>
57
- <td>
58
- <?php $ga_Impr = !empty($data['ga_Impr'])? $data['ga_Impr'] : 6; ?>
59
- <input type="number" min="1" id="ga_Impr" name = "ga_Impr" value = "<?php echo $ga_Impr; ?>"><br/>
60
- <p class="description">This feature sets Impression threshold for category page. It sends hit after these many numbers of products impressions.</p>
61
- </td>
62
- </tr>
63
- <tr>
64
- <td>
65
- <label class = "align-middle" for="ga_IPA">I.P. Anoymization</label>
66
- </td>
67
- <td>
68
- <label class = "align-middle" for="ga_IPA">
69
- <?php $ga_IPA = !empty($data['ga_IPA'])? 'checked' : ''; ?>
70
- <input class="" type="checkbox" name="ga_IPA" id="ga_IPA" <?php echo $ga_IPA; ?>>
71
- Enable I.P. Anonymization
72
- <p class="description">Use this feature to anonymize (or stop collecting) the I.P Address of your users in Google Analytics. Be in legal compliance by using I.P Anonymization which is important for EU countries As per the GDPR compliance</p>
73
- </label>
74
- </td>
75
- </tr>
76
- <tr>
77
- <td>
78
- <label class = "align-middle" for="ga_OPTOUT">Google Analytics Opt Out</label>
79
- </td>
80
- <td>
81
- <label class = "align-middle" for="ga_OPTOUT">
82
- <?php $ga_OPTOUT = !empty($data['ga_OPTOUT'])? 'checked' : ''; ?>
83
- <input class="" type="checkbox" name="ga_OPTOUT" id="ga_OPTOUT" <?php echo $ga_OPTOUT; ?>>
84
- Enable Google Analytics Opt Out (Optional)
85
- <p class="description">Use this feature to provide website visitors the ability to prevent their data from being used by Google Analytics As per the GDPR compliance.Go through the documentation to check the setup</p>
86
- </label>
87
- </td>
88
- </tr>
89
- <tr>
90
- <td>
91
- <label class = "align-middle" for="ga_PrivacyPolicy">Privacy Policy</label>
92
- </td>
93
- <td>
94
- <label class = "align-middle" for="ga_PrivacyPolicy">
95
- <?php $ga_PrivacyPolicy = !empty($data['ga_PrivacyPolicy'])? 'checked' : ''; ?>
96
- <input type="checkbox" onchange="enableSubmit();" name="ga_PrivacyPolicy" id="ga_PrivacyPolicy" required="required" <?php echo $ga_PrivacyPolicy; ?>>
97
- Accept Privacy Policy of Plugin
98
- <p class="description">By using Tatvic Plugin, you agree to Tatvic plugin's <a href= "https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woo_premium_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">Privacy Policy</a></p>
99
- </label>
100
- </td>
101
- </tr>
102
- </tbody>
103
- </table>
104
- <p class="submit save-for-later" id="save-for-later">
105
- <button type="submit" class="btn btn-primary btn-success" id="ee_submit_plugin" name="ee_submit_plugin">Submit</button>
106
- </p>
107
- </form>
108
- </div>
109
- </div>
110
- </div>
111
- <?php require_once('sidebar.php');?>
112
- </div>
113
  </div>
1
  <?php
2
  if(isset($_POST['ee_submit_plugin'])){
3
+ Enhanced_Ecommerce_Google_Settings::add_update_settings('ee_options');
4
  }
5
  $data = unserialize(get_option('ee_options'));
6
  ?>
7
  <div class="container">
8
+ <div class="row" style="margin-left:-11%; !important;">
9
+ <div class= "col col-9" >
10
+ <div class="card mw-100" style="padding:0px;">
11
+ <div class="card-header">
12
+ <h5>Enhanced Ecommerce Google Analytics</h5>
13
+ </div>
14
+ <div class="card-body">
15
+ <form id="ee_plugin_form" method="post" action="" enctype="multipart/form-data" >
16
+ <table class="table table-bordered">
17
+ <tbody>
18
 
19
+ <tr>
20
+ <td>
21
+ <label class="align-middle" for="woocommerce_ee_google_analytics_ga_id">Google Analytics ID</label>
22
+ </td>
23
+ <td>
24
+ <input type="text" id="ga_id" name = "ga_id" required = "required" value="<?php echo $data['ga_id'];?>">
25
+ <i style="cursor: help;" class="fas fa-question-circle" title="Enter your Google Analytics ID here. You can login into your Google Analytics account to find your ID. e.g. UA-XXXXXX-XX"></i>
26
+ </td>
27
+ </tr>
28
+ <tr>
29
+ <td>
30
+ <label class="align-middle" for="tracking_code">Tracking Code</label>
31
+ </td>
32
+ <td>
33
+ <label class = "align-middle" for="ga_code">
34
+ <?php $ga_ST = !empty($data['ga_ST'])? 'checked' : ''; ?>
35
+ <input type="checkbox" name="ga_ST" id="ga_ST" <?php echo $ga_ST; ?> >
36
+ Add Global Site Tracking Code 'gtag.js'
37
+ <p class="description">This feature adds new gtag.js tracking code to your store. You don't need to enable this if gtag.js is implemented via any third party analytics plugin.</p>
38
+ </label><br/>
39
+ <label class = "align-middle" for="ga_enhance_ecommerce">
40
+ <?php $ga_eeT = !empty($data['ga_eeT'])? 'checked' : ''; ?>
41
+ <input type="checkbox" name="ga_eeT" id="ga_eeT" <?php echo $ga_eeT; ?> >
42
+ Add Enhanced Ecommerce Tracking Code
43
+ <p class="description">This feature adds Enhanced Ecommerce Tracking Code to your Store</p>
44
+ </label><br/>
45
+ <label class = "align-middle" for="ga_login_step">
46
+ <?php $ga_gUser = !empty($data['ga_gUser'])? 'checked' : ''; ?>
47
+ <input type="checkbox" name="ga_gUser" id="ga_gUser" <?php echo $ga_gUser; ?> >
48
+ Add Code to Track the Login Step of Guest Users (Optional)
49
+ <p class="description">If you have Guest Check out enable, we recommend you to add this code</p>
50
+ </label><br/>
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td>
55
+ <label for="ga_Impr">Impression Thresold</label>
56
+ </td>
57
+ <td>
58
+ <?php $ga_Impr = !empty($data['ga_Impr'])? $data['ga_Impr'] : 6; ?>
59
+ <input type="number" min="1" id="ga_Impr" name = "ga_Impr" value = "<?php echo $ga_Impr; ?>"><br/>
60
+ <p class="description">This feature sets Impression threshold for category page. It sends hit after these many numbers of products impressions. <br><b>Note : To avoid processing load on server we recommend upto 6 Impression Thresold.</b></p>
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <td>
65
+ <label class = "align-middle" for="ga_IPA">I.P. Anoymization</label>
66
+ </td>
67
+ <td>
68
+ <label class = "align-middle" for="ga_IPA">
69
+ <?php $ga_IPA = !empty($data['ga_IPA'])? 'checked' : ''; ?>
70
+ <input class="" type="checkbox" name="ga_IPA" id="ga_IPA" <?php echo $ga_IPA; ?>>
71
+ Enable I.P. Anonymization
72
+ <p class="description">Use this feature to anonymize (or stop collecting) the I.P Address of your users in Google Analytics. Be in legal compliance by using I.P Anonymization which is important for EU countries As per the GDPR compliance</p>
73
+ </label>
74
+ </td>
75
+ </tr>
76
+ <tr>
77
+ <td>
78
+ <label class = "align-middle" for="ga_OPTOUT">Google Analytics Opt Out</label>
79
+ </td>
80
+ <td>
81
+ <label class = "align-middle" for="ga_OPTOUT">
82
+ <?php $ga_OPTOUT = !empty($data['ga_OPTOUT'])? 'checked' : ''; ?>
83
+ <input class="" type="checkbox" name="ga_OPTOUT" id="ga_OPTOUT" <?php echo $ga_OPTOUT; ?>>
84
+ Enable Google Analytics Opt Out (Optional)
85
+ <p class="description">Use this feature to provide website visitors the ability to prevent their data from being used by Google Analytics As per the GDPR compliance.Go through the documentation to check the setup</p>
86
+ </label>
87
+ </td>
88
+ </tr>
89
+ <tr>
90
+ <td>
91
+ <label class = "align-middle" for="ga_PrivacyPolicy">Privacy Policy</label>
92
+ </td>
93
+ <td>
94
+ <label class = "align-middle" for="ga_PrivacyPolicy">
95
+ <?php $ga_PrivacyPolicy = !empty($data['ga_PrivacyPolicy'])? 'checked' : ''; ?>
96
+ <input type="checkbox" onchange="enableSubmit();" name="ga_PrivacyPolicy" id="ga_PrivacyPolicy" required="required" <?php echo $ga_PrivacyPolicy; ?>>
97
+ Accept Privacy Policy of Plugin
98
+ <p class="description">By using Tatvic Plugin, you agree to Tatvic plugin's <a href= "https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woo_premium_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">Privacy Policy</a></p>
99
+ </label>
100
+ </td>
101
+ </tr>
102
+ </tbody>
103
+ </table>
104
+ <p class="submit save-for-later" id="save-for-later">
105
+ <button type="submit" class="btn btn-primary btn-success" id="ee_submit_plugin" name="ee_submit_plugin">Submit</button>
106
+ </p>
107
+ </form>
108
+ </div>
109
+ </div>
110
+ </div>
111
+ <?php require_once('sidebar.php');?>
112
+ </div>
113
  </div>
admin/partials/sidebar.php CHANGED
@@ -1,40 +1,41 @@
1
  <div class="col col-xs-3">
2
- <div class="card" style="padding: 0px;">
3
- <div class="card-header">
4
- <h5> Important Links</h5>
5
- </div>
6
- <div class="card-body">
7
- <ul>
8
- <li style="padding-bottom:5px;"><a href="http://plugins.tatvic.com/downloads/EE-Woocommerce-Plugin-Documentation.pdf" target="_blank">Installation Instructions</a></li>
9
- <li style="padding-bottom:5px;"><a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/faq/" target="_blank">FAQ</a></li>
10
- <li style="padding-bottom:5px;"><a href="https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store" target="_blank">Support</a></li>
11
- <li style="padding-bottom:5px;"><a href="https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woo_free_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">Privacy Policy</a></li>
12
- <li style="padding-bottom:5px;"><a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/#developers" target="_blank">Change Logs</a></li>
13
- </ul>
14
- </div>
15
- </div>
16
- <div class="card" style="padding: 0px;">
17
- <div class="card-header">
18
- <h4>Rate Us!</h4>
19
- </div>
20
- <div class="card-body">
21
- <ul style="font-weight: 600">
22
- <li style="padding-bottom:5px;">Do you Like our Plugin? Please Spare few minutes to give <a href = "https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store/reviews/" target="_blank">★★★★★</a> Rating..!!</li>
23
- </ul>
24
- </div>
25
- </div>
26
- <div class="card" style="padding: 0px;">
27
- <div class="card-header">
28
- <h5>Tatvic also Offers</h5>
29
- </div>
30
- <div class="card-body">
31
- <ul>
32
- <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/cotlw.png', __FILE__ ) ?>' />&nbsp;<a href="https://wordpress.org/plugins/woo-chrome-one-tap-login/" target="_blank">Chrome One Tap Login for Woocommerce</a>&nbsp;&nbsp;<img src='<?php echo plugins_url('../images/cotlw.gif', __FILE__ ) ?>' /></li>
33
- <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/m1.png', __FILE__ ) ?>' />&nbsp;<a href="https://1.envato.market/79Oky" target="_blank">Actionable Google Analytics for Magento</a></li>
34
- <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/m2.png', __FILE__ ) ?>' />&nbsp;<a href="https://marketplace.magento.com/tatvic-actionablegoogleanalytics.html" target="_blank">Actionable Google Analytics for Magento2</a></li>
35
- <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/shopify_new.png', __FILE__ ) ?>' />&nbsp;<a href="https://apps.shopify.com/google-universal-analytics-enhanced-ecommerce" target="_blank">Actionable Google Analytics for Shopify</a></li>
36
- <li style="padding-bottom:5px;"><img style="width:25px;height: 25px;" src='<?php echo plugins_url('../images/tatvic_logo.png', __FILE__ ) ?>' />&nbsp;<a href="https://www.tatvic.com/excel-add-in-google-analytics/?utm_source=excel_tool_signup&utm_medium=woo_free_plugin&utm_campaign=excel_free_trial" target="_blank">Tatvic Ninja Excel AddIn</a></li>
37
- </ul>
38
- </div>
39
- </div>
 
40
  </div>
1
  <div class="col col-xs-3">
2
+ <div class="card" style="padding: 0px;">
3
+ <div class="card-header">
4
+ <h5> Important Links</h5>
5
+ </div>
6
+ <div class="card-body">
7
+ <ul>
8
+ <li style="padding-bottom:5px;"><a href="http://plugins.tatvic.com/downloads/EE-Woocommerce-Plugin-Documentation.pdf" target="_blank">Installation Instructions</a></li>
9
+ <li style="padding-bottom:5px;"><a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/faq/" target="_blank">FAQ</a></li>
10
+ <li style="padding-bottom:5px;"><a href="https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store" target="_blank">Support</a></li>
11
+ <li style="padding-bottom:5px;"><a href="https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woo_free_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">Privacy Policy</a></li>
12
+ <li style="padding-bottom:5px;"><a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/#developers" target="_blank">Change Logs</a></li>
13
+ </ul>
14
+ </div>
15
+ </div>
16
+ <div class="card" style="padding: 0px;">
17
+ <div class="card-header">
18
+ <h4>Rate Us!</h4>
19
+ </div>
20
+ <div class="card-body">
21
+ <ul style="font-weight: 600">
22
+ <li style="padding-bottom:5px;">Do you Like our Plugin? Please Spare few minutes to give <a href = "https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store/reviews/" target="_blank">★★★★★</a> Rating..!!</li>
23
+ </ul>
24
+ </div>
25
+ </div>
26
+ <div class="card" style="padding: 0px;">
27
+ <div class="card-header">
28
+ <h5>Tatvic also Offers</h5>
29
+ </div>
30
+ <div class="card-body">
31
+ <ul>
32
+ <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/woo.png', __FILE__ ) ?>' />&nbsp;<a href="http://1.envato.market/Yvn3R" target="_blank">Actionable Google Analytics for WooCommerce</a></li>
33
+ <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/cotlw.png', __FILE__ ) ?>' />&nbsp;<a href="https://wordpress.org/plugins/woo-chrome-one-tap-login/" target="_blank">Chrome One Tap Login for Woocommerce</a>&nbsp;&nbsp;<img src='<?php echo plugins_url('../images/cotlw.gif', __FILE__ ) ?>' /></li>
34
+ <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/m1.png', __FILE__ ) ?>' />&nbsp;<a href="https://1.envato.market/79Oky" target="_blank">Actionable Google Analytics for Magento</a></li>
35
+ <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/m2.png', __FILE__ ) ?>' />&nbsp;<a href="https://marketplace.magento.com/tatvic-actionablegoogleanalytics.html" target="_blank">Actionable Google Analytics for Magento2</a></li>
36
+ <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/shopify_new.png', __FILE__ ) ?>' />&nbsp;<a href="https://apps.shopify.com/google-universal-analytics-enhanced-ecommerce" target="_blank">Actionable Google Analytics for Shopify</a></li>
37
+ <li style="padding-bottom:5px;"><img style="width:25px;height: 25px;" src='<?php echo plugins_url('../images/tatvic_logo.png', __FILE__ ) ?>' />&nbsp;<a href="https://www.tatvic.com/excel-add-in-google-analytics/?utm_source=excel_tool_signup&utm_medium=woo_free_plugin&utm_campaign=excel_free_trial" target="_blank">Tatvic Ninja Excel AddIn</a></li>
38
+ </ul>
39
+ </div>
40
+ </div>
41
  </div>
enhanced-ecommerce-google-analytics.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * The plugin bootstrap file
5
  *
@@ -16,20 +15,22 @@
16
  * Plugin Name: Enhanced E-commerce for Woocommerce store
17
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
18
  * Description: Allows Enhanced E-commerce Google Analytics tracking code to be inserted into WooCommerce store pages.
19
- * Version: 2.2.0
20
  * Author: Tatvic
21
- * Author URI: tatvic.com
22
  * License: GPL-2.0+
23
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
24
- * Text Domain: tatvic.com
25
  * Domain Path: /languages
26
  * WC requires at least: 1.4.1
27
- * WC tested up to: 3.6.0
28
  */
29
 
30
- // If this file is called directly, abort.
 
 
31
  if ( ! defined( 'WPINC' ) ) {
32
- die;
33
  }
34
 
35
  /**
@@ -37,14 +38,14 @@ if ( ! defined( 'WPINC' ) ) {
37
  * Start at version 1.0.0 and use SemVer - https://semver.org
38
  * Rename this for your plugin and update it as you release new versions.
39
  */
40
- define( 'PLUGIN_NAME_VERSION', '2.2.0' );
41
  /**
42
  * The code that runs during plugin activation.
43
  * This action is documented in includes/class-enhanced-ecommerce-google-analytics-activator.php
44
  */
45
  function activate_enhanced_ecommerce_google_analytics() {
46
- require_once plugin_dir_path( __FILE__ ) . 'includes/class-enhanced-ecommerce-google-analytics-activator.php';
47
- Enhanced_Ecommerce_Google_Analytics_Activator::activate();
48
  }
49
 
50
  /**
@@ -52,8 +53,8 @@ function activate_enhanced_ecommerce_google_analytics() {
52
  * This action is documented in includes/class-enhanced-ecommerce-google-analytics-deactivator.php
53
  */
54
  function deactivate_enhanced_ecommerce_google_analytics() {
55
- require_once plugin_dir_path( __FILE__ ) . 'includes/class-enhanced-ecommerce-google-analytics-deactivator.php';
56
- Enhanced_Ecommerce_Google_Analytics_Deactivator::deactivate();
57
  }
58
  register_activation_hook( __FILE__, 'activate_enhanced_ecommerce_google_analytics' );
59
  register_deactivation_hook( __FILE__, 'deactivate_enhanced_ecommerce_google_analytics' );
@@ -77,7 +78,7 @@ require plugin_dir_path( __FILE__ ) . 'includes/class-enhanced-ecommerce-google-
77
  function run_enhanced_ecommerce_google_analytics() {
78
 
79
  $plugin = new Enhanced_Ecommerce_Google_Analytics();
80
- $plugin->run();
81
-
82
  }
83
  run_enhanced_ecommerce_google_analytics();
1
  <?php
 
2
  /**
3
  * The plugin bootstrap file
4
  *
15
  * Plugin Name: Enhanced E-commerce for Woocommerce store
16
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
17
  * Description: Allows Enhanced E-commerce Google Analytics tracking code to be inserted into WooCommerce store pages.
18
+ * Version: 2.2.1
19
  * Author: Tatvic
20
+ * Author URI: www.tatvic.com
21
  * License: GPL-2.0+
22
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
23
+ * Text Domain: www.tatvic.com
24
  * Domain Path: /languages
25
  * WC requires at least: 1.4.1
26
+ * WC tested up to: 3.7.0
27
  */
28
 
29
+ /**
30
+ * If this file is called directly, abort.
31
+ */
32
  if ( ! defined( 'WPINC' ) ) {
33
+ die;
34
  }
35
 
36
  /**
38
  * Start at version 1.0.0 and use SemVer - https://semver.org
39
  * Rename this for your plugin and update it as you release new versions.
40
  */
41
+ define( 'PLUGIN_NAME_VERSION', '2.2.1' );
42
  /**
43
  * The code that runs during plugin activation.
44
  * This action is documented in includes/class-enhanced-ecommerce-google-analytics-activator.php
45
  */
46
  function activate_enhanced_ecommerce_google_analytics() {
47
+ require_once plugin_dir_path( __FILE__ ) . 'includes/class-enhanced-ecommerce-google-analytics-activator.php';
48
+ Enhanced_Ecommerce_Google_Analytics_Activator::activate();
49
  }
50
 
51
  /**
53
  * This action is documented in includes/class-enhanced-ecommerce-google-analytics-deactivator.php
54
  */
55
  function deactivate_enhanced_ecommerce_google_analytics() {
56
+ require_once plugin_dir_path( __FILE__ ) . 'includes/class-enhanced-ecommerce-google-analytics-deactivator.php';
57
+ Enhanced_Ecommerce_Google_Analytics_Deactivator::deactivate();
58
  }
59
  register_activation_hook( __FILE__, 'activate_enhanced_ecommerce_google_analytics' );
60
  register_deactivation_hook( __FILE__, 'deactivate_enhanced_ecommerce_google_analytics' );
78
  function run_enhanced_ecommerce_google_analytics() {
79
 
80
  $plugin = new Enhanced_Ecommerce_Google_Analytics();
81
+ $plugin->run();
82
+
83
  }
84
  run_enhanced_ecommerce_google_analytics();
includes/class-enhanced-ecommerce-google-analytics-activator.php CHANGED
@@ -23,16 +23,14 @@
23
 
24
  class Enhanced_Ecommerce_Google_Analytics_Activator {
25
 
26
- /**
27
- * Short Description. (use period)
28
- *
29
- * Long Description.
30
- *
31
- * @since 1.0.0
32
- */
33
- public static function activate() {
34
-
35
- }
36
-
37
 
 
38
  }
23
 
24
  class Enhanced_Ecommerce_Google_Analytics_Activator {
25
 
26
+ /**
27
+ * Short Description. (use period)
28
+ *
29
+ * Long Description.
30
+ *
31
+ * @since 1.0.0
32
+ */
33
+ public static function activate() {
 
 
 
34
 
35
+ }
36
  }
includes/class-enhanced-ecommerce-google-analytics-deactivator.php CHANGED
@@ -33,5 +33,4 @@ class Enhanced_Ecommerce_Google_Analytics_Deactivator {
33
  if (!current_user_can('activate_plugins'))
34
  return;
35
  }
36
-
37
  }
33
  if (!current_user_can('activate_plugins'))
34
  return;
35
  }
 
36
  }
includes/class-enhanced-ecommerce-google-analytics-i18n.php CHANGED
@@ -26,7 +26,6 @@
26
  */
27
  class Enhanced_Ecommerce_Google_Analytics_i18n {
28
 
29
-
30
  /**
31
  * Load the plugin text domain for translation.
32
  *
@@ -41,7 +40,4 @@ class Enhanced_Ecommerce_Google_Analytics_i18n {
41
  );
42
 
43
  }
44
-
45
-
46
-
47
  }
26
  */
27
  class Enhanced_Ecommerce_Google_Analytics_i18n {
28
 
 
29
  /**
30
  * Load the plugin text domain for translation.
31
  *
40
  );
41
 
42
  }
 
 
 
43
  }
includes/class-enhanced-ecommerce-google-analytics-loader.php CHANGED
@@ -23,106 +23,104 @@
23
  */
24
  class Enhanced_Ecommerce_Google_Analytics_Loader {
25
 
26
- /**
27
- * The array of actions registered with WordPress.
28
- *
29
- * @since 1.0.0
30
- * @access protected
31
- * @var array $actions The actions registered with WordPress to fire when the plugin loads.
32
- */
33
- protected $actions;
34
-
35
- /**
36
- * The array of filters registered with WordPress.
37
- *
38
- * @since 1.0.0
39
- * @access protected
40
- * @var array $filters The filters registered with WordPress to fire when the plugin loads.
41
- */
42
- protected $filters;
43
-
44
- /**
45
- * Initialize the collections used to maintain the actions and filters.
46
- *
47
- * @since 1.0.0
48
- */
49
- public function __construct() {
50
-
51
- $this->actions = array();
52
- $this->filters = array();
53
-
54
- }
55
-
56
- /**
57
- * Add a new action to the collection to be registered with WordPress.
58
- *
59
- * @since 1.0.0
60
- * @param string $hook The name of the WordPress action that is being registered.
61
- * @param object $component A reference to the instance of the object on which the action is defined.
62
- * @param string $callback The name of the function definition on the $component.
63
- * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
64
- * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
65
- */
66
- public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
67
- $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
68
- }
69
-
70
- /**
71
- * Add a new filter to the collection to be registered with WordPress.
72
- *
73
- * @since 1.0.0
74
- * @param string $hook The name of the WordPress filter that is being registered.
75
- * @param object $component A reference to the instance of the object on which the filter is defined.
76
- * @param string $callback The name of the function definition on the $component.
77
- * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
78
- * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
79
- */
80
- public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
81
- $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
82
- }
83
-
84
- /**
85
- * A utility function that is used to register the actions and hooks into a single
86
- * collection.
87
- *
88
- * @since 1.0.0
89
- * @access private
90
- * @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
91
- * @param string $hook The name of the WordPress filter that is being registered.
92
- * @param object $component A reference to the instance of the object on which the filter is defined.
93
- * @param string $callback The name of the function definition on the $component.
94
- * @param int $priority The priority at which the function should be fired.
95
- * @param int $accepted_args The number of arguments that should be passed to the $callback.
96
- * @return array The collection of actions and filters registered with WordPress.
97
- */
98
- private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
99
-
100
- $hooks[] = array(
101
- 'hook' => $hook,
102
- 'component' => $component,
103
- 'callback' => $callback,
104
- 'priority' => $priority,
105
- 'accepted_args' => $accepted_args
106
- );
107
- return $hooks;
108
-
109
- }
110
-
111
- /**
112
- * Register the filters and actions with WordPress.
113
- *
114
- * @since 1.0.0
115
- */
116
- public function run() {
117
-
118
- foreach ( $this->filters as $hook ) {
119
- add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
120
- }
121
-
122
- foreach ( $this->actions as $hook ) {
123
- add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
124
- }
125
-
126
- }
127
-
128
  }
23
  */
24
  class Enhanced_Ecommerce_Google_Analytics_Loader {
25
 
26
+ /**
27
+ * The array of actions registered with WordPress.
28
+ *
29
+ * @since 1.0.0
30
+ * @access protected
31
+ * @var array $actions The actions registered with WordPress to fire when the plugin loads.
32
+ */
33
+ protected $actions;
34
+
35
+ /**
36
+ * The array of filters registered with WordPress.
37
+ *
38
+ * @since 1.0.0
39
+ * @access protected
40
+ * @var array $filters The filters registered with WordPress to fire when the plugin loads.
41
+ */
42
+ protected $filters;
43
+
44
+ /**
45
+ * Initialize the collections used to maintain the actions and filters.
46
+ *
47
+ * @since 1.0.0
48
+ */
49
+ public function __construct() {
50
+
51
+ $this->actions = array();
52
+ $this->filters = array();
53
+
54
+ }
55
+
56
+ /**
57
+ * Add a new action to the collection to be registered with WordPress.
58
+ *
59
+ * @since 1.0.0
60
+ * @param string $hook The name of the WordPress action that is being registered.
61
+ * @param object $component A reference to the instance of the object on which the action is defined.
62
+ * @param string $callback The name of the function definition on the $component.
63
+ * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
64
+ * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
65
+ */
66
+ public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
67
+ $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
68
+ }
69
+
70
+ /**
71
+ * Add a new filter to the collection to be registered with WordPress.
72
+ *
73
+ * @since 1.0.0
74
+ * @param string $hook The name of the WordPress filter that is being registered.
75
+ * @param object $component A reference to the instance of the object on which the filter is defined.
76
+ * @param string $callback The name of the function definition on the $component.
77
+ * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
78
+ * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
79
+ */
80
+ public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
81
+ $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
82
+ }
83
+
84
+ /**
85
+ * A utility function that is used to register the actions and hooks into a single
86
+ * collection.
87
+ *
88
+ * @since 1.0.0
89
+ * @access private
90
+ * @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
91
+ * @param string $hook The name of the WordPress filter that is being registered.
92
+ * @param object $component A reference to the instance of the object on which the filter is defined.
93
+ * @param string $callback The name of the function definition on the $component.
94
+ * @param int $priority The priority at which the function should be fired.
95
+ * @param int $accepted_args The number of arguments that should be passed to the $callback.
96
+ * @return array The collection of actions and filters registered with WordPress.
97
+ */
98
+ private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
99
+
100
+ $hooks[] = array(
101
+ 'hook' => $hook,
102
+ 'component' => $component,
103
+ 'callback' => $callback,
104
+ 'priority' => $priority,
105
+ 'accepted_args' => $accepted_args
106
+ );
107
+ return $hooks;
108
+
109
+ }
110
+
111
+ /**
112
+ * Register the filters and actions with WordPress.
113
+ *
114
+ * @since 1.0.0
115
+ */
116
+ public function run() {
117
+
118
+ foreach ( $this->filters as $hook ) {
119
+ add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
120
+ }
121
+
122
+ foreach ( $this->actions as $hook ) {
123
+ add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
124
+ }
125
+ }
 
 
126
  }
includes/class-enhanced-ecommerce-google-analytics.php CHANGED
@@ -29,226 +29,224 @@
29
  */
30
  class Enhanced_Ecommerce_Google_Analytics {
31
 
32
- /**
33
- * The loader that's responsible for maintaining and registering all hooks that power
34
- * the plugin.
35
- *
36
- * @since 1.0.0
37
- * @access protected
38
- * @var Enhanced_Ecommerce_Google_Analytics_Loader $loader Maintains and registers all hooks for the plugin.
39
- */
40
- protected $loader;
41
-
42
- /**
43
- * The unique identifier of this plugin.
44
- *
45
- * @since 1.0.0
46
- * @access protected
47
- * @var string $plugin_name The string used to uniquely identify this plugin.
48
- */
49
- protected $plugin_name;
50
-
51
- /**
52
- * The current version of the plugin.
53
- *
54
- * @since 1.0.0
55
- * @access protected
56
- * @var string $version The current version of the plugin.
57
- */
58
- protected $version;
59
-
60
- /**
61
- * Define the core functionality of the plugin.
62
- *
63
- * Set the plugin name and the plugin version that can be used throughout the plugin.
64
- * Load the dependencies, define the locale, and set the hooks for the admin area and
65
- * the public-facing side of the site.
66
- *
67
- * @since 1.0.0
68
- */
69
- public function __construct() {
70
- if ( defined( 'PLUGIN_NAME_VERSION' ) ) {
71
- $this->version = PLUGIN_NAME_VERSION;
72
- } else {
73
- $this->version = '2.2.0';
74
- }
75
- $this->plugin_name = 'enhanced-ecommerce-google-analytics';
76
- $this->load_dependencies();
77
- $this->set_locale();
78
- $this->define_admin_hooks();
79
- $this->define_public_hooks();
80
- add_filter( 'plugin_action_links_' .plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_name . '.php' ), array($this,'tvc_plugin_action_links'),10 );
81
- }
82
-
83
- /**
84
- * Load the required dependencies for this plugin.
85
- *
86
- * Include the following files that make up the plugin:
87
- *
88
- * - Enhanced_Ecommerce_Google_Analytics_Loader. Orchestrates the hooks of the plugin.
89
- * - Enhanced_Ecommerce_Google_Analytics_i18n. Defines internationalization functionality.
90
- * - Enhanced_Ecommerce_Google_Analytics_Admin. Defines all hooks for the admin area.
91
- * - Enhanced_Ecommerce_Google_Analytics_Public. Defines all hooks for the public side of the site.
92
- *
93
- * Create an instance of the loader which will be used to register the hooks
94
- * with WordPress.
95
- *
96
- * @since 1.0.0
97
- * @access private
98
- */
99
- private function load_dependencies() {
100
-
101
- /**
102
- * The class responsible for orchestrating the actions and filters of the
103
- * core plugin.
104
- */
105
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-enhanced-ecommerce-google-analytics-loader.php';
106
-
107
- /**
108
- * The class responsible for defining internationalization functionality
109
- * of the plugin.
110
- */
111
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-enhanced-ecommerce-google-analytics-i18n.php';
112
-
113
- /**
114
- * The class responsible for defining all actions that occur in the admin area.
115
- */
116
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-enhanced-ecommerce-google-analytics-admin.php';
117
-
118
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-enhanced-ecommerce-google-analytics-settings.php';
119
-
120
- /**
121
- * The class responsible for defining all actions that occur in the public-facing
122
- * side of the site.
123
- */
124
-
125
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-enhanced-ecommerce-google-analytics-public.php';
126
- $this->loader = new Enhanced_Ecommerce_Google_Analytics_Loader();
127
-
128
- }
129
-
130
- /**
131
- * Define the locale for this plugin for internationalization.
132
- *
133
- * Uses the Enhanced_Ecommerce_Google_Analytics_i18n class in order to set the domain and to register the hook
134
- * with WordPress.
135
- *
136
- * @since 1.0.0
137
- * @access private
138
- */
139
- private function set_locale() {
140
-
141
- $plugin_i18n = new Enhanced_Ecommerce_Google_Analytics_i18n();
142
-
143
- $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
144
-
145
- }
146
-
147
- /**
148
- * Register all of the hooks related to the admin area functionality
149
- * of the plugin.
150
- *
151
- * @since 1.0.0
152
- * @access private
153
- */
154
- private function define_admin_hooks() {
155
-
156
- $plugin_admin = new Enhanced_Ecommerce_Google_Analytics_Admin( $this->get_plugin_name(), $this->get_version() );
157
- $this->loader->add_action( 'admin_menu', $plugin_admin, 'display_admin_page' );
158
- // $this->loader->add_action("admin_menu", $plugin_admin, "add_new_menu");
159
- $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
160
- $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
161
- }
162
-
163
- /**
164
- * Register all of the hooks related to the public-facing functionality
165
- * of the plugin.
166
- *
167
- * @since 1.0.0
168
- * @access private
169
- */
170
- private function define_public_hooks() {
171
-
172
- $plugin_public = new Enhanced_Ecommerce_Google_Analytics_Public( $this->get_plugin_name(), $this->get_version() );
173
- $this->loader->add_action("wp_head", $plugin_public, "ee_settings");
174
- $this->loader->add_action("wp_footer", $plugin_public, "t_products_impre_clicks");
175
- $this->loader->add_action("woocommerce_thankyou", $plugin_public, "ecommerce_tracking_code");
176
- $this->loader->add_action("woocommerce_after_shop_loop_item", $plugin_public, "bind_product_metadata");
177
- $this->loader->add_action("woocommerce_after_single_product", $plugin_public, "product_detail_view");
178
- $this->loader->add_action("woocommerce_after_cart",$plugin_public, "remove_cart_tracking");
179
- //check out step 1,2,3
180
- $this->loader->add_action("woocommerce_before_checkout_billing_form", $plugin_public, "checkout_step_1_tracking");
181
  $this->loader->add_action("woocommerce_after_checkout_billing_form", $plugin_public, "checkout_step_2_tracking");
182
  $this->loader->add_action("woocommerce_after_checkout_billing_form", $plugin_public, "checkout_step_3_tracking");
183
  $this->loader->add_action("woocommerce_after_add_to_cart_button", $plugin_public, "add_to_cart");
184
-
185
  //Advanced Store data Tracking
186
- //add version details in footer
187
- $this->loader->add_action("wp_footer", $plugin_public, "add_plugin_details");
188
-
189
  //Add Dev ID
190
  $this->loader->add_action("wp_head", $plugin_public, "add_dev_id");
191
  $this->loader->add_action("wp_footer",$plugin_public, "tvc_store_meta_data");
192
- }
193
-
194
- /**
195
- * Run the loader to execute all of the hooks with WordPress.
196
- *
197
- * @since 1.0.0
198
- */
199
- public function run() {
200
- if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
201
- add_action('woocommerce_init' , function (){
202
- $this->loader->run();
203
- });
204
- }
205
- else{
206
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
207
- if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
208
- $this->loader->run();
209
- }
210
- }
211
- }
212
-
213
- /**
214
- * The name of the plugin used to uniquely identify it within the context of
215
- * WordPress and to define internationalization functionality.
216
- *
217
- * @since 1.0.0
218
- * @return string The name of the plugin.
219
- */
220
- public function get_plugin_name() {
221
- return $this->plugin_name;
222
- }
223
-
224
- /**
225
- * The reference to the class that orchestrates the hooks with the plugin.
226
- *
227
- * @since 1.0.0
228
- * @return Enhanced_Ecommerce_Google_Analytics_Loader Orchestrates the hooks of the plugin.
229
- */
230
- public function get_loader() {
231
- return $this->loader;
232
- }
233
-
234
- /**
235
- * Retrieve the version number of the plugin.
236
- *
237
- * @since 1.0.0
238
- * @return string The version number of the plugin.
239
- */
240
- public function get_version() {
241
- return $this->version;
242
- }
243
-
244
- public function tvc_plugin_action_links($links) {
245
- $setting_url = 'admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=general_settings';
246
- $links[] = '<a href="' . get_admin_url(null, $setting_url) . '">Settings</a>';
247
- $links[] = '<a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/#faq" target="_blank">FAQ</a>';
248
- $links[] = '<a href="http://plugins.tatvic.com/downloads/EE-Woocommerce-Plugin-Documentation.pdf" target="_blank">Documentation</a>';
249
- $links[] = '<a href="https://1.envato.market/Yvn3R" target="_blank"><b>Upgrade to Premium</b></a>';
250
- return $links;
251
- }
252
-
253
-
254
  }
29
  */
30
  class Enhanced_Ecommerce_Google_Analytics {
31
 
32
+ /**
33
+ * The loader that's responsible for maintaining and registering all hooks that power
34
+ * the plugin.
35
+ *
36
+ * @since 1.0.0
37
+ * @access protected
38
+ * @var Enhanced_Ecommerce_Google_Analytics_Loader $loader Maintains and registers all hooks for the plugin.
39
+ */
40
+ protected $loader;
41
+
42
+ /**
43
+ * The unique identifier of this plugin.
44
+ *
45
+ * @since 1.0.0
46
+ * @access protected
47
+ * @var string $plugin_name The string used to uniquely identify this plugin.
48
+ */
49
+ protected $plugin_name;
50
+
51
+ /**
52
+ * The current version of the plugin.
53
+ *
54
+ * @since 1.0.0
55
+ * @access protected
56
+ * @var string $version The current version of the plugin.
57
+ */
58
+ protected $version;
59
+
60
+ /**
61
+ * Define the core functionality of the plugin.
62
+ *
63
+ * Set the plugin name and the plugin version that can be used throughout the plugin.
64
+ * Load the dependencies, define the locale, and set the hooks for the admin area and
65
+ * the public-facing side of the site.
66
+ *
67
+ * @since 1.0.0
68
+ */
69
+ public function __construct() {
70
+ if ( defined( 'PLUGIN_NAME_VERSION' ) ) {
71
+ $this->version = PLUGIN_NAME_VERSION;
72
+ } else {
73
+ $this->version = '2.2.1';
74
+ }
75
+ $this->plugin_name = 'enhanced-ecommerce-google-analytics';
76
+ $this->load_dependencies();
77
+ $this->set_locale();
78
+ $this->define_admin_hooks();
79
+ $this->define_public_hooks();
80
+ add_filter( 'plugin_action_links_' .plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_name . '.php' ), array($this,'tvc_plugin_action_links'),10 );
81
+ }
82
+
83
+ /**
84
+ * Load the required dependencies for this plugin.
85
+ *
86
+ * Include the following files that make up the plugin:
87
+ *
88
+ * - Enhanced_Ecommerce_Google_Analytics_Loader. Orchestrates the hooks of the plugin.
89
+ * - Enhanced_Ecommerce_Google_Analytics_i18n. Defines internationalization functionality.
90
+ * - Enhanced_Ecommerce_Google_Analytics_Admin. Defines all hooks for the admin area.
91
+ * - Enhanced_Ecommerce_Google_Analytics_Public. Defines all hooks for the public side of the site.
92
+ *
93
+ * Create an instance of the loader which will be used to register the hooks
94
+ * with WordPress.
95
+ *
96
+ * @since 1.0.0
97
+ * @access private
98
+ */
99
+ private function load_dependencies() {
100
+
101
+ /**
102
+ * The class responsible for orchestrating the actions and filters of the
103
+ * core plugin.
104
+ */
105
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-enhanced-ecommerce-google-analytics-loader.php';
106
+
107
+ /**
108
+ * The class responsible for defining internationalization functionality
109
+ * of the plugin.
110
+ */
111
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-enhanced-ecommerce-google-analytics-i18n.php';
112
+
113
+ /**
114
+ * The class responsible for defining all actions that occur in the admin area.
115
+ */
116
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-enhanced-ecommerce-google-analytics-admin.php';
117
+
118
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-enhanced-ecommerce-google-analytics-settings.php';
119
+
120
+ /**
121
+ * The class responsible for defining all actions that occur in the public-facing
122
+ * side of the site.
123
+ */
124
+
125
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-enhanced-ecommerce-google-analytics-public.php';
126
+ $this->loader = new Enhanced_Ecommerce_Google_Analytics_Loader();
127
+
128
+ }
129
+
130
+ /**
131
+ * Define the locale for this plugin for internationalization.
132
+ *
133
+ * Uses the Enhanced_Ecommerce_Google_Analytics_i18n class in order to set the domain and to register the hook
134
+ * with WordPress.
135
+ *
136
+ * @since 1.0.0
137
+ * @access private
138
+ */
139
+ private function set_locale() {
140
+
141
+ $plugin_i18n = new Enhanced_Ecommerce_Google_Analytics_i18n();
142
+
143
+ $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
144
+
145
+ }
146
+
147
+ /**
148
+ * Register all of the hooks related to the admin area functionality
149
+ * of the plugin.
150
+ *
151
+ * @since 1.0.0
152
+ * @access private
153
+ */
154
+ private function define_admin_hooks() {
155
+
156
+ $plugin_admin = new Enhanced_Ecommerce_Google_Analytics_Admin( $this->get_plugin_name(), $this->get_version() );
157
+ $this->loader->add_action( 'admin_menu', $plugin_admin, 'display_admin_page' );
158
+ // $this->loader->add_action("admin_menu", $plugin_admin, "add_new_menu");
159
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
160
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
161
+ }
162
+
163
+ /**
164
+ * Register all of the hooks related to the public-facing functionality
165
+ * of the plugin.
166
+ *
167
+ * @since 1.0.0
168
+ * @access private
169
+ */
170
+ private function define_public_hooks() {
171
+
172
+ $plugin_public = new Enhanced_Ecommerce_Google_Analytics_Public( $this->get_plugin_name(), $this->get_version() );
173
+ $this->loader->add_action("wp_head", $plugin_public, "ee_settings");
174
+ $this->loader->add_action("wp_footer", $plugin_public, "t_products_impre_clicks");
175
+ $this->loader->add_action("woocommerce_after_shop_loop_item", $plugin_public, "bind_product_metadata");
176
+ $this->loader->add_action("woocommerce_thankyou", $plugin_public, "ecommerce_tracking_code");
177
+ $this->loader->add_action("woocommerce_after_single_product", $plugin_public, "product_detail_view");
178
+ $this->loader->add_action("woocommerce_after_cart",$plugin_public, "remove_cart_tracking");
179
+ //check out step 1,2,3
180
+ $this->loader->add_action("woocommerce_before_checkout_billing_form", $plugin_public, "checkout_step_1_tracking");
181
  $this->loader->add_action("woocommerce_after_checkout_billing_form", $plugin_public, "checkout_step_2_tracking");
182
  $this->loader->add_action("woocommerce_after_checkout_billing_form", $plugin_public, "checkout_step_3_tracking");
183
  $this->loader->add_action("woocommerce_after_add_to_cart_button", $plugin_public, "add_to_cart");
184
+
185
  //Advanced Store data Tracking
186
+ //add version details in footer
187
+ $this->loader->add_action("wp_footer", $plugin_public, "add_plugin_details");
188
+
189
  //Add Dev ID
190
  $this->loader->add_action("wp_head", $plugin_public, "add_dev_id");
191
  $this->loader->add_action("wp_footer",$plugin_public, "tvc_store_meta_data");
192
+ }
193
+
194
+ /**
195
+ * Run the loader to execute all of the hooks with WordPress.
196
+ *
197
+ * @since 1.0.0
198
+ */
199
+ public function run() {
200
+ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
201
+ add_action('woocommerce_init' , function (){
202
+ $this->loader->run();
203
+ });
204
+ }
205
+ else{
206
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
207
+ if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
208
+ $this->loader->run();
209
+ }
210
+ }
211
+ }
212
+
213
+ /**
214
+ * The name of the plugin used to uniquely identify it within the context of
215
+ * WordPress and to define internationalization functionality.
216
+ *
217
+ * @since 1.0.0
218
+ * @return string The name of the plugin.
219
+ */
220
+ public function get_plugin_name() {
221
+ return $this->plugin_name;
222
+ }
223
+
224
+ /**
225
+ * The reference to the class that orchestrates the hooks with the plugin.
226
+ *
227
+ * @since 1.0.0
228
+ * @return Enhanced_Ecommerce_Google_Analytics_Loader Orchestrates the hooks of the plugin.
229
+ */
230
+ public function get_loader() {
231
+ return $this->loader;
232
+ }
233
+
234
+ /**
235
+ * Retrieve the version number of the plugin.
236
+ *
237
+ * @since 1.0.0
238
+ * @return string The version number of the plugin.
239
+ */
240
+ public function get_version() {
241
+ return $this->version;
242
+ }
243
+
244
+ public function tvc_plugin_action_links($links) {
245
+ $setting_url = 'admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=general_settings';
246
+ $links[] = '<a href="' . get_admin_url(null, $setting_url) . '">Settings</a>';
247
+ $links[] = '<a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/#faq" target="_blank">FAQ</a>';
248
+ $links[] = '<a href="http://plugins.tatvic.com/downloads/EE-Woocommerce-Plugin-Documentation.pdf" target="_blank">Documentation</a>';
249
+ $links[] = '<a href="https://1.envato.market/Yvn3R" target="_blank"><b>Upgrade to Premium</b></a>';
250
+ return $links;
251
+ }
 
 
252
  }
includes/index.php CHANGED
@@ -1 +1,4 @@
1
- <?php // Silence is golden
 
 
 
1
+ <?php
2
+ /**
3
+ * Silence is golden
4
+ */
index.php CHANGED
@@ -1 +1,4 @@
1
- <?php // Silence is golden
 
 
 
1
+ <?php
2
+ /**
3
+ * Silence Is Golden
4
+ */
public/class-enhanced-ecommerce-google-analytics-public.php CHANGED
@@ -21,7 +21,7 @@
21
  * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
22
  */
23
  class Enhanced_Ecommerce_Google_Analytics_Public {
24
- /**
25
  * Init and hook in the integration.
26
  *
27
  * @access public
@@ -29,74 +29,63 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
29
  */
30
  //set plugin version
31
  public $tvc_eeVer = '2.2.0';
32
-
33
- protected $tvc_aga;
34
-
35
- protected $ga_id;
36
-
37
- protected $ga_LC;
38
-
39
- protected $ga_ST;
40
-
41
- protected $ga_gCkout;
42
-
43
- protected $ga_eeT;
44
-
45
- protected $ga_DF;
46
-
47
- protected $ga_imTh;
48
-
49
- protected $ga_OPTOUT;
50
-
51
- protected $ga_PrivacyPolicy;
52
-
53
- protected $ga_IPA;
54
-
55
  public function __construct($plugin_name, $version) {
56
-
57
-
58
- //session for product position count
59
- //session_start inserted bcoz it gives warning ---- 2.1.5
60
-
61
- //removal of session_start because it gives warning in wp backend editor ---- 2.1.6
62
- // if (session_status() == PHP_SESSION_NONE) {
63
- // session_start();
64
- // }
65
- // $_SESSION['t_npcnt']=0;
66
- // $_SESSION['t_fpcnt']=0;
67
- // Define user set variables -- Always use short names
68
- $this->plugin_name = $plugin_name;
69
- $this->version = $version;
70
- $this->tvc_aga = $this->get_option("tvc_aga");
71
  $this->ga_id = $this->get_option("ga_id");
72
  $this->ga_ST = $this->get_option("ga_ST");
73
  $this->ga_gCkout = $this->get_option("ga_gCkout") == "on" ? true : false; //guest checkout
74
  $this->ga_gUser = $this->get_option("ga_gUser") == "on" ? true : false; //guest checkout
75
  $this->ga_eeT = $this->get_option("ga_eeT");
76
  $this->ga_DF = $this->get_option("ga_DF") == "on" ? true : false;
77
- $this->ga_imTh = $this->get_option("ga_imTh") == "" ? 6 : $this->get_option("ga_imTh");
78
  $this->ga_OPTOUT = $this->get_option("ga_OPTOUT") == "on" ? true : false; //Google Analytics Opt Out
79
  $this->ga_PrivacyPolicy = $this->get_option("ga_PrivacyPolicy") == "on" ? true : false;
80
  $this->ga_IPA = $this->get_option("ga_IPA") == "on" ? true : false; //IP Anony.
81
-
82
- if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
83
- // Put your plugin code here
84
- add_action('woocommerce_init' , function (){
85
- $this->ga_LC = get_woocommerce_currency(); //Local Currency from Back end
86
- $this->wc_version_compare("tvc_lc=" . json_encode($this->ga_LC) . ";");
87
- });
88
- }
 
 
 
 
 
 
 
 
 
 
89
  }
90
- public function get_option($key){
91
- $ee_options = array();
92
- $my_option = get_option( 'ee_options' );
93
- if(!empty($my_option)){
94
- $ee_options = unserialize($my_option);
95
- }
96
- if(isset($ee_options[$key])){
97
- return $ee_options[$key];
98
- }
99
- }
100
  /**
101
  * Get store meta data for trouble shoot
102
  * @access public
@@ -107,25 +96,25 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
107
  global $woocommerce;
108
  $tvc_sMetaData = array();
109
 
110
- $tvc_sMetaData = array(
111
- 'tvc_wcv' => $woocommerce->version,
112
- 'tvc_wpv' => get_bloginfo('version'),
113
- 'tvc_eev' => $this->tvc_eeVer,
114
- 'tvc_cnf' => array(
115
- 't_ee' => $this->ga_eeT,
116
- 't_df' => $this->ga_DF,
117
- 't_gUser'=>$this->ga_gUser,
118
- 't_UAen'=>$this->ga_ST,
119
- 't_thr' => $this->ga_imTh,
120
- 't_IPA' => $this->ga_IPA,
121
- 't_OptOut' => $this->ga_OPTOUT,
122
- 't_PrivacyPolicy' => $this->ga_PrivacyPolicy,
123
- )
124
- );
125
- $this->wc_version_compare("tvc_smd=" . json_encode($tvc_sMetaData) . ";");
126
  }
127
 
128
- /**
129
  * add dev id
130
  *
131
  * @access public
@@ -144,7 +133,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
144
  function add_plugin_details() {
145
  echo '<!--Enhanced Ecommerce Google Analytics Plugin for Woocommerce by Tatvic Plugin Version:'.$this->tvc_eeVer.'-->';
146
  }
147
-
148
  /**
149
  * Check if tracking is disabled
150
  *
@@ -166,7 +155,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
166
  */
167
  function wc_version_compare($codeSnippet) {
168
  global $woocommerce;
169
-
170
  if (version_compare($woocommerce->version, "2.1", ">=")) {
171
  wc_enqueue_js($codeSnippet);
172
  } else {
@@ -174,7 +163,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
174
  }
175
  }
176
  /**
177
- * Enhanced Ecommerce GA plugin Settings
178
  *
179
  * @access public
180
  * @return void
@@ -192,7 +181,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
192
  return;
193
  }
194
  //common validation----end
195
- $set_domain_name = "auto";
196
  // IP Anonymization
197
  if ($this->ga_IPA) {
198
  $ga_ip_anonymization = '"anonymize_ip":true,';
@@ -200,7 +189,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
200
  $ga_ip_anonymization ="";
201
  }
202
  if($this->ga_OPTOUT) {
203
- echo '<script>
204
  // Set to the same value as the web property used on the site
205
  var gaProperty = "'.$tracking_id.'";
206
 
@@ -227,9 +216,9 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
227
  gtag("config", "'.esc_js($tracking_id).'",{'.$ga_ip_anonymization.' "cookie_domain":"'.$set_domain_name.'"});
228
  </script>
229
  ';
230
- echo $code;
231
- }
232
-
233
  /**
234
  * Google Analytics eCommerce tracking
235
  *
@@ -238,7 +227,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
238
  * @return void
239
  */
240
  function ecommerce_tracking_code($order_id) {
241
-
242
  global $woocommerce;
243
  if ($this->disable_tracking($this->ga_eeT) || current_user_can("manage_options") || get_post_meta($order_id, "_tracked", true) == 1)
244
  return;
@@ -276,14 +265,14 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
276
  foreach ($order->get_items() as $item) {
277
  $_product = $order->get_product_from_item($item);
278
  if (isset($_product->variation_data)) {
279
- $categories=esc_js(wc_get_formatted_variation($_product->get_variation_attributes(), true));
280
-
281
  } else {
282
  $out = array();
283
  if(version_compare($woocommerce->version, "2.7", "<")){
284
- $categories = get_the_terms($_product->id, "product_cat");
285
  }else{
286
- $categories = get_the_terms($_product->get_id(), "product_cat");
287
  }
288
 
289
  if ($categories) {
@@ -295,48 +284,48 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
295
  }
296
  //orderpage Prod json
297
  if(version_compare($woocommerce->version, "2.7", "<")){
298
- $orderpage_prod_Array[get_permalink($_product->id)]=array(
299
- "tvc_id" => esc_html($_product->id),
300
- "tvc_i" => esc_js($_product->get_sku() ? $_product->get_sku() : $_product->id),
301
  "tvc_n" => html_entity_decode($item["name"]),
302
  "tvc_p" => esc_js($order->get_item_total($item)),
303
  "tvc_c" => $categories,
304
  "tvc_q"=>esc_js($item["qty"])
305
- );
306
  }else{
307
- $orderpage_prod_Array[get_permalink($_product->get_id())]=array(
308
  "tvc_id" => esc_html($_product->get_id()),
309
  "tvc_i" => esc_js($_product->get_sku() ? $_product->get_sku() : $_product->get_id()),
310
  "tvc_n" => html_entity_decode($_product->get_title()),
311
  "tvc_p" => esc_js($order->get_item_total($item)),
312
  "tvc_c" => $categories,
313
  "tvc_q"=>esc_js($item["qty"])
314
- );
315
- }
316
  }
317
  //make json for prod meta data on order page
318
- $this->wc_version_compare("tvc_oc=" . json_encode($orderpage_prod_Array) . ";");
319
  }
320
 
321
- //get shipping cost based on version >2.1 get_total_shipping() < get_shipping
322
- if (version_compare($woocommerce->version, "2.1", ">=")) {
323
- $tvc_sc = $order->get_total_shipping();
324
- } else {
325
- $tvc_sc = $order->get_shipping();
326
- }
327
- //orderpage transcation data json
328
- $orderpage_trans_Array=array(
329
- "id"=> esc_js($order->get_order_number()), // Transaction ID. Required
330
- "affiliation"=> esc_js(get_bloginfo('name')), // Affiliation or store name
331
- "revenue"=>esc_js($order->get_total()), // Grand Total
332
- "tax"=> esc_js($order->get_total_tax()), // Tax
333
- "shipping"=> esc_js($tvc_sc), // Shipping
334
- "coupon"=>$coupons_list
335
- );
336
- //make json for trans data on order page
337
- $this->wc_version_compare("tvc_td=" . json_encode($orderpage_trans_Array) . ";");
338
-
339
- $code ='
340
  var items = [];
341
  //set local currencies
342
  gtag("set", {"currency": tvc_lc});
@@ -382,8 +371,9 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
382
  if (!is_single())
383
  return;
384
  global $product,$woocommerce;
 
385
  if(version_compare($woocommerce->version, "2.7", "<")){
386
- $category = get_the_terms($product->ID, "product_cat");
387
  }else{
388
  $category = get_the_terms($product->get_id(), "product_cat");
389
  }
@@ -398,11 +388,11 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
398
 
399
  $code = '
400
  var items = [];
401
- //set local currencies
402
  gtag("set", {"currency": tvc_lc});
403
  jQuery("[class*=single_add_to_cart_button]").click(function() {
404
 
405
- // Enhanced E-commerce Add to cart clicks
406
  gtag("event", "add_to_cart", {
407
  "event_category":"Enhanced-Ecommerce",
408
  "event_label":"add_to_cart_click",
@@ -430,14 +420,13 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
430
  */
431
  public function product_detail_view() {
432
 
433
-
434
  if ($this->disable_tracking($this->ga_eeT)) {
435
  return;
436
  }
437
 
438
  global $product,$woocommerce;
439
  if(version_compare($woocommerce->version, "2.7", "<")){
440
- $category = get_the_terms($product->ID, "product_cat");
441
  }else{
442
  $category = get_the_terms($product->get_id(), "product_cat");
443
  }
@@ -452,27 +441,28 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
452
  //product detail view json
453
  if(version_compare($woocommerce->version, "2.7", "<")){
454
  $prodpage_detail_json = array(
455
- "tvc_id" => esc_html($product->id),
456
- "tvc_i" => $product->get_sku() ? $product->get_sku() : $product->id,
457
- "tvc_n" => $product->get_title(),
458
- "tvc_c" => $categories,
459
- "tvc_p" => $product->get_price()
460
- );
461
  }else{
462
  $prodpage_detail_json = array(
463
- "tvc_id" => esc_html($product->get_id()),
464
- "tvc_i" => $product->get_sku() ? $product->get_sku() : $product->get_id(),
465
- "tvc_n" => $product->get_title(),
466
- "tvc_c" => $categories,
467
- "tvc_p" => $product->get_price()
468
- );
469
  }
470
-
471
- if (empty($prodpage_detail_json)) { //prod page array
 
472
  $prodpage_detail_json = array();
473
  }
474
  //prod page detail view json
475
- $this->wc_version_compare("tvc_po=" . json_encode($prodpage_detail_json) . ";");
476
  $code = '
477
  gtag("event", "view_item", {
478
  "event_category":"Enhanced-Ecommerce",
@@ -489,8 +479,8 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
489
  ';
490
  //check woocommerce version
491
  if(is_product()){
492
- $this->wc_version_compare($code);
493
- }
494
  }
495
 
496
  /**
@@ -502,18 +492,17 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
502
  */
503
  public function bind_product_metadata() {
504
 
505
-
506
  if ($this->disable_tracking($this->ga_eeT)) {
507
  return;
508
  }
509
 
510
  global $product,$woocommerce;
511
  if (version_compare($woocommerce->version, "2.7", "<")) {
512
- $category = get_the_terms($product->Id, "product_cat");
513
- } else {
514
- $category = get_the_terms($product->get_id(), "product_cat");
515
- }
516
-
517
  $categories = "";
518
 
519
  if ($category) {
@@ -530,60 +519,60 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
530
  if (!is_array($homepage_json_fp) && !is_array($homepage_json_rp) && !is_array($homepage_json_ATC_link)) {
531
  $homepage_json_fp = array();
532
  $homepage_json_rp = array();
533
- $homepage_json_ATC_link=array();
534
  }
535
 
536
- // ATC link Array
537
- if(version_compare($woocommerce->version, "2.7", "<")){
538
- $homepage_json_ATC_link[$product->add_to_cart_url()]=array("ATC-link"=>get_permalink($product->id));
539
- }else{
540
- $homepage_json_ATC_link[$product->add_to_cart_url()]=array("ATC-link"=>get_permalink($product->get_id()));
541
- }
542
- //check if product is featured product or not
543
  if ($product->is_featured()) {
544
- //check if product is already exists in homepage featured json
545
- if(version_compare($woocommerce->version, "2.7", "<")){
546
  if(!array_key_exists(get_permalink($product->id),$homepage_json_fp)){
547
- $homepage_json_fp[get_permalink($product->id)] = array(
548
- "tvc_id" => esc_html($product->id),
549
- "tvc_i" => esc_html($product->get_sku() ? $product->get_sku() : $product->id),
550
- "tvc_n" => esc_html($product->get_title()),
551
- "tvc_p" => esc_html($product->get_price()),
552
- "tvc_c" => esc_html($categories),
553
- "ATC-link"=>$product->add_to_cart_url()
554
- );
555
- //else add product in homepage recent product json
556
- }else {
557
- $homepage_json_rp[get_permalink($product->id)] =array(
558
- "tvc_id" => esc_html($product->id),
559
- "tvc_i" => esc_html($product->get_sku() ? $product->get_sku() : $product->id),
560
- "tvc_n" => esc_html($product->get_title()),
561
- "tvc_p" => esc_html($product->get_price()),
562
- "tvc_c" => esc_html($categories)
563
- );
564
- }
565
- }else{
566
  if(!array_key_exists(get_permalink($product->get_id()),$homepage_json_fp)){
567
- $homepage_json_fp[get_permalink($product->get_id())] = array(
568
- "tvc_id" => esc_html($product->get_id()),
569
- "tvc_i" => esc_html($product->get_sku() ? $product->get_sku() : $product->get_id()),
570
- "tvc_n" => esc_html($product->get_title()),
571
- "tvc_p" => esc_html($product->get_price()),
572
- "tvc_c" => esc_html($categories),
573
- "ATC-link"=>$product->add_to_cart_url()
574
- );
575
- //else add product in homepage recent product json
576
- }else {
577
- $homepage_json_rp[get_permalink($product->get_id())] =array(
578
- "tvc_id" => esc_html($product->get_id()),
579
- "tvc_i" => esc_html($product->get_sku() ? $product->get_sku() : $product->get_id()),
580
- "tvc_n" => esc_html($product->get_title()),
581
- "tvc_p" => esc_html($product->get_price()),
582
- "tvc_c" => esc_html($categories)
583
- );
584
- }
585
- }
586
-
587
  } else {
588
  //else prod add in homepage recent json
589
  if(version_compare($woocommerce->version, "2.7", "<")){
@@ -593,7 +582,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
593
  "tvc_n" => esc_html($product->get_title()),
594
  "tvc_p" => esc_html($product->get_price()),
595
  "tvc_c" => esc_html($categories)
596
- );
597
  }else{
598
  $homepage_json_rp[get_permalink($product->get_id())] =array(
599
  "tvc_id" => esc_html($product->get_id()),
@@ -601,9 +590,9 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
601
  "tvc_n" => esc_html($product->get_title()),
602
  "tvc_p" => esc_html($product->get_price()),
603
  "tvc_c" => esc_html($categories)
604
- );
605
  }
606
-
607
  }
608
  }
609
  //if product page then related product page array
@@ -615,58 +604,57 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
615
  // ATC link Array
616
  if(version_compare($woocommerce->version, "2.7", "<")){
617
  $prodpage_json_ATC_link[$product->add_to_cart_url()]=array("ATC-link"=>get_permalink($product->id));
618
-
619
- $prodpage_json_relProd[get_permalink($product->id)] = array(
620
- "tvc_id" => esc_html($product->id),
621
- "tvc_i" => esc_html($product->get_sku() ? $product->get_sku() : $product->id),
622
- "tvc_n" => esc_html($product->get_title()),
623
- "tvc_p" => esc_html($product->get_price()),
624
- "tvc_c" => esc_html($categories),
625
  );
626
  }else{
627
- $prodpage_json_ATC_link[$product->add_to_cart_url()]=array("ATC-link"=>get_permalink($product->get_id()));
628
-
629
- $prodpage_json_relProd[get_permalink($product->get_id())] = array(
630
- "tvc_id" => esc_html($product->get_id()),
631
- "tvc_i" => esc_html($product->get_sku() ? $product->get_sku() : $product->get_id()),
632
- "tvc_n" => esc_html($product->get_title()),
633
- "tvc_p" => esc_html($product->get_price()),
634
- "tvc_c" => esc_html($categories)
635
-
636
  );
637
  }
638
  }
639
  //category page, search page and shop page json
640
  else if (is_product_category() || is_search() || is_shop()) {
641
- if (!is_array($catpage_json) && !is_array($catpage_json_ATC_link)){
642
- $catpage_json=array();
643
- $catpage_json_ATC_link=array();
644
- }
645
- //cat page ATC array
646
- if(version_compare($woocommerce->version, "2.7", "<")){
647
  $catpage_json_ATC_link[$product->add_to_cart_url()]=array("ATC-link"=>get_permalink($product->id));
648
 
649
- $catpage_json[get_permalink($product->id)] =array(
650
- "tvc_id" => esc_html($product->id),
651
- "tvc_i" => esc_html($product->get_sku() ? $product->get_sku() : $product->id),
652
- "tvc_n" => esc_html($product->get_title()),
653
- "tvc_p" => esc_html($product->get_price()),
654
- "tvc_c" => esc_html($categories),
655
  );
656
- }else{
657
  $catpage_json_ATC_link[$product->add_to_cart_url()]=array("ATC-link"=>get_permalink($product->get_id()));
658
 
659
  $catpage_json[get_permalink($product->get_id())] =array(
660
- "tvc_id" => esc_html($product->get_id()),
661
- "tvc_i" => esc_html($product->get_sku() ? $product->get_sku() : $product->get_id()),
662
- "tvc_n" => esc_html($product->get_title()),
663
- "tvc_p" => esc_html($product->get_price()),
664
- "tvc_c" => esc_html($categories)
665
-
666
  );
667
- }
668
-
669
  }
 
670
  }
671
 
672
  /**
@@ -679,10 +667,10 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
679
  if ($this->disable_tracking($this->ga_eeT)) {
680
  return;
681
  }
682
-
683
  //get impression threshold
684
  $impression_threshold = $this->ga_imTh;
685
-
686
  //Product impression on Home Page
687
  global $homepage_json_fp,$homepage_json_ATC_link, $homepage_json_rp,$prodpage_json_relProd,$catpage_json,$prodpage_json_ATC_link,$catpage_json_ATC_link;
688
  //home page json for featured products and recent product sections
@@ -694,7 +682,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
694
  $homepage_json_fp=array(); //define empty array so if empty then in json will be []
695
  }
696
  if(empty($homepage_json_rp)){ //home page recent product array
697
- $homepage_json_rp=array();
698
  }
699
  if(empty($prodpage_json_relProd)){ //prod page related section array
700
  $prodpage_json_relProd=array();
@@ -718,7 +706,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
718
  //category page json
719
  $this->wc_version_compare("tvc_pgc=" . json_encode($catpage_json) . ";");
720
  $this->wc_version_compare("catpage_json_ATC_link=" . json_encode($catpage_json_ATC_link) . ";");
721
-
722
  $hmpg_impressions_jQ = '
723
  var items = [];
724
  //set local currencies
@@ -809,7 +797,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
809
 
810
  ';
811
  if(is_home() || is_front_page()){
812
- $hmpg_impressions_jQ .='
813
  if(tvc_fp.length !== 0){
814
  t_products_impre_clicks(tvc_fp,"fp");
815
  }
@@ -852,10 +840,10 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
852
 </