Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 1.0.18

Version Description

  • 11/04/2016 =
    • Fixed - Compatibility with Google Tag Manager for Wordpress by DuracellTomi
Download this release

Release Info

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

Code changes from version 1.0.16 to 1.0.18

includes/class-wc-enhanced-ecommerce-google-analytics-integration.php CHANGED
@@ -18,7 +18,7 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
18
  * @return void
19
  */
20
  //set plugin version
21
- public $tvc_eeVer = '1.0.16';
22
  public function __construct() {
23
 
24
  //Set Global Variables
@@ -40,18 +40,17 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
40
  $this->init_settings();
41
 
42
  // Define user set variables -- Always use short names
43
- $this->ga_email = $this->get_option("ga_email");
44
- $this->ga_id = $this->get_option("ga_id");
45
- $this->ga_Dname = $this->get_option("ga_Dname");
46
  $this->ga_LC = get_woocommerce_currency(); //Local Currency yuppi! Got from Back end
47
  //set local currency variable on all page
48
  $this->wc_version_compare("tvc_lc=" . json_encode($this->ga_LC) . ";");
49
- $this->ga_ST = $this->get_option("ga_ST");
50
- $this->ga_gCkout = $this->get_option("ga_gCkout") == "yes" ? true : false; //guest checkout
51
- $this->ga_gUser = $this->get_option("ga_gUser") == "yes" ? true : false; //guest checkout
52
- $this->ga_eeT = $this->get_option("ga_eeT");
53
- $this->ga_DF = $this->get_option("ga_DF") == "yes" ? true : false;
54
- $this->ga_imTh = $this->get_option("ga_imTh");
55
 
56
 
57
  //Save Changes action for admin settings
@@ -59,7 +58,7 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
59
 
60
  // API Call to LS with e-mail
61
  // Tracking code
62
- add_action("wp_head", array($this, "google_tracking_code"));
63
  add_action("woocommerce_thankyou", array($this, "ecommerce_tracking_code"));
64
 
65
  // Enhanced Ecommerce product impression hook
@@ -131,6 +130,110 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
131
  function add_plugin_details() {
132
  echo '<!--Enhanced Ecommerce Google Analytics Plugin for Woocommerce by Tatvic Plugin Version:'.$this->tvc_eeVer.'-->';
133
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
 
135
  /**
136
  * Initialise Settings Form Fields
@@ -140,14 +243,6 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
140
  */
141
  function init_form_fields() {
142
  $this->form_fields = array(
143
- "ga_email" => array(
144
- "title" => __("Email Address (Optional)", "woocommerce"),
145
- "description" => __("Provide your work email address to receive plugin enhancement updates", "woocommerce"),
146
- "type" => "email",
147
- "placeholder" => "example@test.com",
148
- "desc_tip" => true,
149
- "default" => get_option("ga_email") // Backwards compat
150
- ),
151
  "ga_id" => array(
152
  "title" => __("Google Analytics ID", "woocommerce"),
153
  "description" => __("Enter your Google Analytics ID here. You can login into your Google Analytics account to find your ID. e.g.<code>UA-XXXXX-X</code>", "woocommerce"),
@@ -208,72 +303,6 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
208
  "default" => get_option("ga_imTh") ? get_option("ga_imTh") : "6" // Backwards compat
209
  ),
210
  );
211
- /* When user updates the email, post it to the remote server */
212
- if (isset($_GET["tab"]) && isset($_REQUEST["section"]) && isset($_REQUEST["woocommerce_".$this->id."_ga_email"])) {
213
- $current_tab = ( empty($_GET["tab"]) ) ? false : sanitize_text_field(urldecode($_GET["tab"]));
214
- $current_section = ( empty($_REQUEST["section"]) ) ? false : sanitize_text_field(urldecode($_REQUEST["section"]));
215
- $save_for_the_plugin = ($current_tab == "integration" ) && ($current_section == $this->id);
216
-
217
- $update_made_for_email = $_REQUEST["woocommerce_".$this->id."_ga_email"] != $this->get_option("ga_email");
218
- if ($save_for_the_plugin && $update_made_for_email) {
219
- // if ($_REQUEST["woocommerce_".$this->id."_ga_email"] != "")
220
- {
221
- $email = $_REQUEST["woocommerce_".$this->id."_ga_email"];
222
- $this->send_email_to_tatvic($email,'active');
223
- }
224
- }
225
- }
226
- }
227
-
228
- /**
229
- * Google Analytics standard tracking
230
- *
231
- * @access public
232
- * @return void
233
- */
234
- function google_tracking_code() {
235
- global $woocommerce;
236
-
237
- //common validation----start
238
- if (is_admin() || current_user_can("manage_options") || $this->ga_ST == "no") {
239
- return;
240
- }
241
-
242
- $tracking_id = $this->ga_id;
243
-
244
- if (!$tracking_id) {
245
- return;
246
- }
247
-
248
- //common validation----end
249
-
250
- if (!empty($this->ga_Dname)) {
251
- $set_domain_name = esc_js($this->ga_Dname);
252
- } else {
253
- $set_domain_name = "auto";
254
- }
255
-
256
- //add display features
257
- if ($this->ga_DF) {
258
- $ga_display_feature_code = 'ga("require", "displayfeatures");';
259
- } else {
260
- $ga_display_feature_code = "";
261
- }
262
-
263
- $code = '
264
- (function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
265
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
266
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
267
- })(window,document,"script","//www.google-analytics.com/analytics.js","ga");
268
- ga("create", "' . esc_js($tracking_id) . '", "' . $set_domain_name . '");
269
- ' . $ga_display_feature_code . '
270
-
271
- ga("send", "pageview");';
272
-
273
- //include this on all pages except order confirmation page.
274
- if (!is_order_received_page()) {
275
- echo "<script>" . $code . "</script>";
276
- }
277
  }
278
 
279
  /**
@@ -286,16 +315,15 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
286
  function ecommerce_tracking_code($order_id) {
287
  global $woocommerce;
288
 
289
- if ($this->disable_tracking($this->ga_eeT) || current_user_can("manage_options") || get_post_meta($order_id, "_ga_tracked", true) == 1)
290
  return;
291
 
292
  $tracking_id = $this->ga_id;
293
-
294
  if (!$tracking_id)
295
  return;
296
 
297
  // Doing eCommerce tracking so unhook standard tracking from the footer
298
- remove_action("wp_footer", array($this, "google_tracking_code"));
299
 
300
  // Get the order and output tracking code
301
  $order = new WC_Order($order_id);
@@ -420,7 +448,7 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
420
 
421
  //check woocommerce version
422
  $this->wc_version_compare($code);
423
- update_post_meta($order_id, "_ga_tracked", 1);
424
  }
425
 
426
  /**
@@ -1080,91 +1108,7 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
1080
  //make product data json on check out page
1081
  $this->wc_version_compare("tvc_ch=" . json_encode($chkout_json) . ";");
1082
  }
1083
-
1084
- /**
1085
- * Check if tracking is disabled
1086
- *
1087
- * @access private
1088
- * @param mixed $type
1089
- * @return bool
1090
- */
1091
- private function disable_tracking($type) {
1092
- if (is_admin() || current_user_can("manage_options") || (!$this->ga_id ) || "no" == $type) {
1093
- return true;
1094
- }
1095
- }
1096
-
1097
- /**
1098
- * woocommerce version compare
1099
- *
1100
- * @access public
1101
- * @return void
1102
- */
1103
- function wc_version_compare($codeSnippet) {
1104
- global $woocommerce;
1105
- if (version_compare($woocommerce->version, "2.1", ">=")) {
1106
- wc_enqueue_js($codeSnippet);
1107
- } else {
1108
- $woocommerce->add_inline_js($codeSnippet);
1109
- }
1110
- }
1111
-
1112
- /**
1113
- * check UA is enabled or not
1114
- *
1115
- * @access public
1116
- */
1117
- function admin_check_UA_enabled() {
1118
- $t_tab_name = $_GET['tab'];
1119
- if($t_tab_name=='integration'){
1120
-
1121
- echo '<script>
1122
- jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_ST").change(function(){
1123
- t_ga_chk=jQuery(this).is(":checked");
1124
-
1125
- if(t_ga_chk){
1126
- jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_DF").removeAttr("disabled");
1127
- }else{
1128
- jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_DF").attr("disabled",true);
1129
- t_display_chk=jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_DF").is(":checked");
1130
- if(t_display_chk){
1131
- jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_DF").removeAttr("checked");
1132
- } }
1133
- });
1134
- //Pugin Promotion
1135
- jQuery("form#mainform").after("<a href=http://bit.ly/1yFqA04 target=_blank><img src=http://www.tatvic.com/blog/wp-content/uploads/2015/02/woo_plugin_promotion.png title=Actionable Google Analytics Plugin by Tatvic alt=Actionable Google Analytics Plugin by Tatvic></a>");
1136
- </script>';
1137
- }
1138
- }
1139
-
1140
- /**
1141
- * Sending email to remote server
1142
- *
1143
- * @access public
1144
- * @return void
1145
- */
1146
- public function send_email_to_tatvic($email,$status) {
1147
- $url = "http://dev.tatvic.com/leadgen/woocommerce-plugin/store_email/";
1148
- //set POST variables
1149
- if($email == ""){
1150
-
1151
- $email = "marketing@tatvic.com";
1152
- }
1153
- $fields = array(
1154
- "email" => urlencode($email),
1155
- "domain_name" => urlencode(get_site_url()),
1156
- "status"=>urlencode($status)
1157
- );
1158
- wp_remote_post($url, array(
1159
- "method" => "POST",
1160
- "timeout" => 1,
1161
- "httpversion" => "1.0",
1162
- "blocking" => false,
1163
- "headers" => array(),
1164
- "body" => $fields
1165
- )
1166
- );
1167
- }
1168
 
1169
  }
1170
 
18
  * @return void
19
  */
20
  //set plugin version
21
+ public $tvc_eeVer = '1.0.18';
22
  public function __construct() {
23
 
24
  //Set Global Variables
40
  $this->init_settings();
41
 
42
  // Define user set variables -- Always use short names
43
+ $this->ga_id = $this->get_option("ga_id");
44
+ $this->ga_Dname = $this->get_option("ga_Dname");
 
45
  $this->ga_LC = get_woocommerce_currency(); //Local Currency yuppi! Got from Back end
46
  //set local currency variable on all page
47
  $this->wc_version_compare("tvc_lc=" . json_encode($this->ga_LC) . ";");
48
+ $this->ga_ST = $this->get_option("ga_ST");
49
+ $this->ga_gCkout = $this->get_option("ga_gCkout") == "yes" ? true : false; //guest checkout
50
+ $this->ga_gUser = $this->get_option("ga_gUser") == "yes" ? true : false; //guest checkout
51
+ $this->ga_eeT = $this->get_option("ga_eeT");
52
+ $this->ga_DF = $this->get_option("ga_DF") == "yes" ? true : false;
53
+ $this->ga_imTh = $this->get_option("ga_imTh");
54
 
55
 
56
  //Save Changes action for admin settings
58
 
59
  // API Call to LS with e-mail
60
  // Tracking code
61
+ add_action("wp_head", array($this, "ee_settings"));
62
  add_action("woocommerce_thankyou", array($this, "ecommerce_tracking_code"));
63
 
64
  // Enhanced Ecommerce product impression hook
130
  function add_plugin_details() {
131
  echo '<!--Enhanced Ecommerce Google Analytics Plugin for Woocommerce by Tatvic Plugin Version:'.$this->tvc_eeVer.'-->';
132
  }
133
+ /**
134
+ * check UA is enabled or not
135
+ *
136
+ * @access public
137
+ */
138
+ function admin_check_UA_enabled() {
139
+
140
+ if(isset($_GET['tab']) && $_GET['tab'] =='integration' ){
141
+
142
+ echo '<script>
143
+ jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_ST").change(function(){
144
+ t_ga_chk=jQuery(this).is(":checked");
145
+
146
+ if(t_ga_chk){
147
+ jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_DF").removeAttr("disabled");
148
+ }else{
149
+ jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_DF").attr("disabled",true);
150
+ t_display_chk=jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_DF").is(":checked");
151
+ if(t_display_chk){
152
+ jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_DF").removeAttr("checked");
153
+ } }
154
+ });
155
+
156
+ //Pugin Promotion
157
+ jQuery("form#mainform").after("<a href=http://bit.ly/1yFqA04 target=_blank><img src='.plugins_url( '/woo_plugin_promotion.png' , __FILE__ ).' title=Actionable Google Analytics Plugin by Tatvic alt=Actionable Google Analytics Plugin by Tatvic></a>");
158
+ </script>';
159
+ }
160
+ }
161
+
162
+ /**
163
+ * Check if tracking is disabled
164
+ *
165
+ * @access private
166
+ * @param mixed $type
167
+ * @return bool
168
+ */
169
+ private function disable_tracking($type) {
170
+ if (is_admin() || current_user_can("manage_options") || (!$this->ga_id ) || "no" == $type) {
171
+ return true;
172
+ }
173
+ }
174
+
175
+ /**
176
+ * woocommerce version compare
177
+ *
178
+ * @access public
179
+ * @return void
180
+ */
181
+ function wc_version_compare($codeSnippet) {
182
+ global $woocommerce;
183
+ if (version_compare($woocommerce->version, "2.1", ">=")) {
184
+ wc_enqueue_js($codeSnippet);
185
+ } else {
186
+ $woocommerce->add_inline_js($codeSnippet);
187
+ }
188
+ }
189
+ /**
190
+ * Enhanced Ecommerce GA plugin Settings
191
+ *
192
+ * @access public
193
+ * @return void
194
+ */
195
+ function ee_settings() {
196
+ global $woocommerce;
197
+
198
+ //common validation----start
199
+ if (is_admin() || current_user_can("manage_options") || $this->ga_ST == "no") {
200
+ return;
201
+ }
202
+ $tracking_id = $this->ga_id;
203
+
204
+ if (!$tracking_id) {
205
+ return;
206
+ }
207
+ //common validation----end
208
+
209
+ if (!empty($this->ga_Dname)) {
210
+ $set_domain_name = esc_js($this->ga_Dname);
211
+ } else {
212
+ $set_domain_name = "auto";
213
+ }
214
+
215
+ //add display features
216
+ if ($this->ga_DF) {
217
+ $ga_display_feature_code = 'ga("require", "displayfeatures");';
218
+ } else {
219
+ $ga_display_feature_code = "";
220
+ }
221
+
222
+ $code = '
223
+ (function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
224
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
225
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
226
+ })(window,document,"script","//www.google-analytics.com/analytics.js","ga");
227
+ ga("create", "' . esc_js($tracking_id) . '", "' . $set_domain_name . '");
228
+ ' . $ga_display_feature_code . '
229
+
230
+ ga("send", "pageview");';
231
+
232
+ //include this on all pages except order confirmation page.
233
+ if (!is_order_received_page()) {
234
+ echo "<script>" . $code . "</script>";
235
+ }
236
+ }
237
 
238
  /**
239
  * Initialise Settings Form Fields
243
  */
244
  function init_form_fields() {
245
  $this->form_fields = array(
 
 
 
 
 
 
 
 
246
  "ga_id" => array(
247
  "title" => __("Google Analytics ID", "woocommerce"),
248
  "description" => __("Enter your Google Analytics ID here. You can login into your Google Analytics account to find your ID. e.g.<code>UA-XXXXX-X</code>", "woocommerce"),
303
  "default" => get_option("ga_imTh") ? get_option("ga_imTh") : "6" // Backwards compat
304
  ),
305
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  }
307
 
308
  /**
315
  function ecommerce_tracking_code($order_id) {
316
  global $woocommerce;
317
 
318
+ if ($this->disable_tracking($this->ga_eeT) || current_user_can("manage_options") || get_post_meta($order_id, "_tracked", true) == 1)
319
  return;
320
 
321
  $tracking_id = $this->ga_id;
 
322
  if (!$tracking_id)
323
  return;
324
 
325
  // Doing eCommerce tracking so unhook standard tracking from the footer
326
+ remove_action("wp_footer", array($this, "ee_settings"));
327
 
328
  // Get the order and output tracking code
329
  $order = new WC_Order($order_id);
448
 
449
  //check woocommerce version
450
  $this->wc_version_compare($code);
451
+ update_post_meta($order_id, "_tracked", 1);
452
  }
453
 
454
  /**
1108
  //make product data json on check out page
1109
  $this->wc_version_compare("tvc_ch=" . json_encode($chkout_json) . ";");
1110
  }
1111
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1112
 
1113
  }
1114
 
includes/woo_plugin_promotion.png ADDED
Binary file
readme.txt CHANGED
@@ -2,20 +2,20 @@
2
  Contributors: Tatvic
3
  Plugin Name: Enhanced Ecommerce for Woocommerce store
4
  Plugin URI: http://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/
5
- Tags: Google Analytics, Universal Analytics, Enhanced E-commerce, E-commerce, e-commerce, woo-commerce,Ecommerce,woocommerce, commerce, Wordpress Enhanced Ecommerce
6
  Author URI: http://www.tatvic.com/
7
  Author: Tatvic
8
  Requires at least: 3.6
9
- Tested up to: 4.1
10
- Stable tag: 1.0.16
11
- Version: 1.0.16
12
  License: GPLv3
13
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
14
 
15
- Provides integration between Google Analytics Enhanced Ecommerce and WooCommerce.
16
 
17
  == Description ==
18
- <a href="http://www.tatvic.com/enhanced-ecommerce-google-analytics-plugin-woocommerce/">Enhanced Ecommerce Google Analytics</a> is a Free WooCommerce Plugin which allows you to use the newly launched feature of Google Analytics – Enhanced Ecommerce.You can track the user behavior across your e-commerce store starting from product views to thank you page.Enhanced Ecommerce is still in beta and supports only Universal Analytics.
19
 
20
  = Features of Plugin =
21
  1. Quick & Easy installation from the wordpress interface
@@ -58,7 +58,7 @@ We have recently launched an Advanced Google Analytics Plugin for WooCommerce wh
58
  1. Download the plugin file to your computer and unzip it
59
  2. Using an FTP program, or your hosting control panel, upload the unzipped plugin folder to your WordPress installation’s wp-content/plugins/ directory
60
  3. Activate the plugin from the Plugins menu within the WordPress admin
61
- 4. Enter your email-address and Google Analytics ID for the plugin to enable the tracking code
62
 
63
  == Screenshots ==
64
  1. Enable Enhanced E-commerce for your profile/view. This is a profile / view level setting and can be accessed under Admin > View > E-commerce Settings. Also, add meaningful labels for your checkout steps. We recommend you to label as, Step 1 : Checkout View; Step 2 : Login; Step 3 : Proceed to payment;
@@ -161,4 +161,11 @@ Important Note: When you update the plugin, please save your settings again.
161
  * Email Field made optional
162
 
163
  = 1.0.16 - 01/04/2015 =
164
- * Minor Bug Fixes as per Woredpress Guidlines
 
 
 
 
 
 
 
2
  Contributors: Tatvic
3
  Plugin Name: Enhanced Ecommerce for Woocommerce store
4
  Plugin URI: http://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/
5
+ Tags: Google Analytics, Universal Analytics, Enhanced E-commerce, E-commerce, e-commerce, woo-commerce,Ecommerce,woocommerce, commerce, Wordpress Enhanced Ecommerce, Woocommerce Enhanced Ecommerce, Woocommerce Google Analytics, Google Analytics Plugin, Enhanced Ecommerce Plugin
6
  Author URI: http://www.tatvic.com/
7
  Author: Tatvic
8
  Requires at least: 3.6
9
+ Tested up to: 4.4
10
+ Stable tag: 1.0.18
11
+ Version: 1.0.18
12
  License: GPLv3
13
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
14
 
15
+ Provides integration between Enhanced Ecommerce feature of Google Analytics and WooCommerce.
16
 
17
  == Description ==
18
+ <a href="http://www.tatvic.com/enhanced-ecommerce-google-analytics-plugin-woocommerce/">Enhanced Ecommerce Google Analytics</a> is a Free WooCommerce Plugin which allows you to use the newly launched feature of Google Analytics – Enhanced Ecommerce.You can track the user behavior across your e-commerce store starting from product views to thank you page. Enhanced Ecommerce supports only Universal Analytics.
19
 
20
  = Features of Plugin =
21
  1. Quick & Easy installation from the wordpress interface
58
  1. Download the plugin file to your computer and unzip it
59
  2. Using an FTP program, or your hosting control panel, upload the unzipped plugin folder to your WordPress installation’s wp-content/plugins/ directory
60
  3. Activate the plugin from the Plugins menu within the WordPress admin
61
+ 4. Enter your Universal Analytics ID for the plugin to enable the tracking code
62
 
63
  == Screenshots ==
64
  1. Enable Enhanced E-commerce for your profile/view. This is a profile / view level setting and can be accessed under Admin > View > E-commerce Settings. Also, add meaningful labels for your checkout steps. We recommend you to label as, Step 1 : Checkout View; Step 2 : Login; Step 3 : Proceed to payment;
161
  * Email Field made optional
162
 
163
  = 1.0.16 - 01/04/2015 =
164
+ * Minor Bug Fixes as per Wordpress Guidlines
165
+
166
+ = 1.0.17 - 19/02/2016 =
167
+ * Fixed - Notice: Undefined index: tab
168
+ * Minor Bug Fixes as per Wordpress Guidlines
169
+
170
+ = 1.0.18 - 11/04/2016 =
171
+ * Fixed - Compatibility with Google Tag Manager for Wordpress by DuracellTomi
woocommerce-enhanced-ecommerce-google-analytics-integration.php CHANGED
@@ -21,7 +21,7 @@
21
  Description: Allows Enhanced E-commerce Google Analytics tracking code to be inserted into WooCommerce store pages.
22
  Author: Tatvic
23
  Author URI: http://www.tatvic.com
24
- Version: 1.0.16
25
  */
26
  if (!defined('ABSPATH')) {
27
  exit; // Exit if accessed directly
@@ -38,28 +38,6 @@ function wc_enhanced_ecommerce_google_analytics_add_integration($integrations) {
38
  return $integrations;
39
  }
40
 
41
- //function to call controller
42
- function send_email_to_tatvic($email, $status) {
43
- $url = "http://dev.tatvic.com/leadgen/woocommerce-plugin/store_email/";
44
- //set POST variables
45
- if($email == ""){
46
- $email = "marketing@tatvic.com";
47
- }
48
- $fields = array(
49
- "email" => urlencode($email),
50
- "domain_name" => urlencode(get_site_url()),
51
- "status" => urlencode($status)
52
- );
53
- wp_remote_post($url, array(
54
- "method" => "POST",
55
- "timeout" => 1,
56
- "httpversion" => "1.0",
57
- "blocking" => false,
58
- "headers" => array(),
59
- "body" => $fields
60
- )
61
- );
62
- }
63
 
64
  add_filter('woocommerce_integrations', 'wc_enhanced_ecommerce_google_analytics_add_integration', 10);
65
 
@@ -78,54 +56,5 @@ function tvc_plugin_action_links($links) {
78
  return $links;
79
  }
80
 
81
- //function to catch Plugin activation
82
- function ee_plugin_activate() {
83
- $PID = "enhanced_ecommerce_google_analytics";
84
- $chk_Settings = get_option('woocommerce_' . $PID . '_settings');
85
- if ($chk_Settings) {
86
- if (array_key_exists("ga_email", $chk_Settings)) {
87
- send_email_to_tatvic($chk_Settings['ga_email'], 'active');
88
- }
89
- }
90
- }
91
-
92
- //function to catch Plugin deactivation
93
- function ee_plugin_dectivate() {
94
- if (!current_user_can('activate_plugins'))
95
- return;
96
- $plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : '';
97
- $chk_nonce = check_admin_referer("deactivate-plugin_{$plugin}");
98
-
99
- $PID = "enhanced_ecommerce_google_analytics";
100
- $chk_Settings = get_option('woocommerce_' . $PID . '_settings');
101
-
102
- if ($chk_nonce && $chk_Settings) {
103
- if (array_key_exists("ga_email", $chk_Settings)) {
104
- send_email_to_tatvic($chk_Settings['ga_email'], 'inactive');
105
- }
106
- }
107
- }
108
-
109
- //function to catch Plugin deletion
110
- function ee_plugin_delete() {
111
-
112
- if (!current_user_can('activate_plugins'))
113
- return;
114
-
115
- $chk_nonce = check_admin_referer('bulk-plugins');
116
-
117
- if ($_GET['action'] == 'delete-selected') {
118
- $PID = "enhanced_ecommerce_google_analytics";
119
- $chk_Settings = get_option('woocommerce_' . $PID . '_settings');
120
- if ($chk_nonce && $chk_Settings) {
121
- if (array_key_exists("ga_email", $chk_Settings)) {
122
- send_email_to_tatvic($chk_Settings['ga_email'], 'delete');
123
- }
124
- }
125
- }
126
- }
127
 
128
- register_activation_hook(__FILE__, 'ee_plugin_activate');
129
- register_deactivation_hook(__FILE__, 'ee_plugin_dectivate');
130
- register_uninstall_hook(__FILE__, 'ee_plugin_delete');
131
  ?>
21
  Description: Allows Enhanced E-commerce Google Analytics tracking code to be inserted into WooCommerce store pages.
22
  Author: Tatvic
23
  Author URI: http://www.tatvic.com
24
+ Version: 1.0.18
25
  */
26
  if (!defined('ABSPATH')) {
27
  exit; // Exit if accessed directly
38
  return $integrations;
39
  }
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
  add_filter('woocommerce_integrations', 'wc_enhanced_ecommerce_google_analytics_add_integration', 10);
43
 
56
  return $links;
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
 
 
 
 
60
  ?>