Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 1.0.9

Version Description

  • 09/11/2014 =
    • Fixed- Minor bug on order page
Download this release

Release Info

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

Code changes from version 1.0.8 to 1.0.9

includes/class-wc-enhanced-ecommerce-google-analytics-integration.php CHANGED
@@ -72,7 +72,7 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
72
  */
73
 
74
  function add_plugin_details(){
75
- echo '<!-- Plugin Version: 1.0.8-->';
76
  }
77
 
78
  /**
@@ -189,17 +189,21 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
189
  $ga_display_feature_code = "";
190
  }
191
 
192
- echo '<script>
193
- (function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
194
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
195
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
196
  })(window,document,"script","//www.google-analytics.com/analytics.js","ga");
197
 
198
  ga("create", "' . esc_js($tracking_id) . '", "' . $set_domain_name . '");
199
  '.$ga_display_feature_code.'
200
- ga("require", "ec", "ec.js");
201
- </script>';
202
-
 
 
 
 
 
203
  }
204
 
205
  /**
@@ -286,7 +290,11 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
286
  "tax": "' . esc_js($order->get_total_tax()) . '" // Tax
287
  });';
288
 
289
- echo "<script type='text/javascript'>" . $code . "</script>";
 
 
 
 
290
 
291
  update_post_meta($order_id, "_ga_tracked", 1);
292
  }
72
  */
73
 
74
  function add_plugin_details(){
75
+ echo '<!-- Plugin Version: 1.0.9-->';
76
  }
77
 
78
  /**
189
  $ga_display_feature_code = "";
190
  }
191
 
192
+ $code='(function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
 
193
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
194
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
195
  })(window,document,"script","//www.google-analytics.com/analytics.js","ga");
196
 
197
  ga("create", "' . esc_js($tracking_id) . '", "' . $set_domain_name . '");
198
  '.$ga_display_feature_code.'
199
+ ga("require", "ec", "ec.js");';
200
+
201
+ if (version_compare($woocommerce->version, "2.1", ">=")) {
202
+ wc_enqueue_js($code);
203
+ } else {
204
+ $woocommerce->add_inline_js($code);
205
+ }
206
+
207
  }
208
 
209
  /**
290
  "tax": "' . esc_js($order->get_total_tax()) . '" // Tax
291
  });';
292
 
293
+ if (version_compare($woocommerce->version, "2.1", ">=")) {
294
+ wc_enqueue_js($code);
295
+ } else {
296
+ $woocommerce->add_inline_js($code);
297
+ }
298
 
299
  update_post_meta($order_id, "_ga_tracked", 1);
300
  }
readme.txt CHANGED
@@ -7,8 +7,8 @@ Author URI: http://www.tatvic.com/
7
  Author: Tatvic
8
  Requires at least: 3.6
9
  Tested up to: 3.9.2
10
- Stable tag: 1.0.8
11
- Version: 1.0.8
12
  License: GPLv3
13
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
14
 
@@ -94,4 +94,7 @@ Starting the WooCommerce 2.1 release there are no conflicts. However for earlier
94
  * Fixed-Allow back quotes and single quotes in product name, category name etc.
95
 
96
  = 1.0.8 - 09/09/2014 =
97
- * Fixed- Minor bugs
 
 
 
7
  Author: Tatvic
8
  Requires at least: 3.6
9
  Tested up to: 3.9.2
10
+ Stable tag: 1.0.9
11
+ Version: 1.0.9
12
  License: GPLv3
13
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
14
 
94
  * Fixed-Allow back quotes and single quotes in product name, category name etc.
95
 
96
  = 1.0.8 - 09/09/2014 =
97
+ * Fixed- Minor bugs
98
+
99
+ = 1.0.9 - 09/11/2014 =
100
+ * Fixed- Minor bug on order page
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.8
25
  */
26
 
27
  // Add the integration to WooCommerce
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.9
25
  */
26
 
27
  // Add the integration to WooCommerce