Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 1.0.5

Version Description

Download this release

Release Info

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

Code changes from version 1.0.4 to 1.0.5

includes/class-wc-enhanced-ecommerce-google-analytics-integration.php CHANGED
@@ -204,11 +204,10 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
204
  foreach ($order->get_items() as $item) {
205
  $_product = $order->get_product_from_item($item);
206
 
207
- $code .= "ga('ec:addProduct', {";
208
- $code .= "'id': '" . esc_js($order->get_order_number()) . "',";
209
  $code .= "'name': '" . esc_js($item['name']) . "',";
210
- $code .= "'sku': '" . esc_js($_product->get_sku() ? __('SKU:', 'woocommerce') . ' ' . $_product->get_sku() : $_product->id ) . "',";
211
-
212
  if (isset($_product->variation_data)) {
213
 
214
  $code .= "'category': '" . esc_js(woocommerce_get_formatted_variation($_product->variation_data, true)) . "',";
@@ -446,7 +445,7 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
446
  'quantity': $(this).parents('tr').find('.product-quantity .qty').val()
447
  });
448
  ga('ec:setAction', 'remove');
449
- ga('send', 'event', 'UX', 'click', 'remove from cart',{'nonInteraction': 1});
450
  });"
451
  );
452
  } else {
@@ -457,7 +456,7 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
457
  'quantity': $(this).parents('tr').find('.product-quantity .qty').val()
458
  });
459
  ga('ec:setAction', 'remove');
460
- ga('send', 'event', 'UX', 'click', 'remove from cart',{'nonInteraction': 1});
461
  });"
462
  );
463
  }
@@ -544,7 +543,7 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
544
  if (!$this->disable_tracking($this->ga_standard_tracking_enabled)) {
545
  $inline_js = "ga('send', 'event', 'Enhanced-Ecommerce', 'pageview', 'footer',{'nonInteraction': 1})";
546
  } else {
547
- $inline_js = "ga('send','pageview');";
548
  }
549
 
550
  if (version_compare($woocommerce->version, '2.1', '>=')) {
204
  foreach ($order->get_items() as $item) {
205
  $_product = $order->get_product_from_item($item);
206
 
207
+ $code .= "ga('ec:addProduct', {";
 
208
  $code .= "'name': '" . esc_js($item['name']) . "',";
209
+ $code .= "'id': '" . esc_js($_product->get_sku()) . "',";
210
+
211
  if (isset($_product->variation_data)) {
212
 
213
  $code .= "'category': '" . esc_js(woocommerce_get_formatted_variation($_product->variation_data, true)) . "',";
445
  'quantity': $(this).parents('tr').find('.product-quantity .qty').val()
446
  });
447
  ga('ec:setAction', 'remove');
448
+ ga('send', 'event', 'Enhanced-Ecommerce', 'click', 'remove from cart',{'nonInteraction': 1});
449
  });"
450
  );
451
  } else {
456
  'quantity': $(this).parents('tr').find('.product-quantity .qty').val()
457
  });
458
  ga('ec:setAction', 'remove');
459
+ ga('send', 'event', 'Enhanced-Ecommerce', 'click', 'remove from cart',{'nonInteraction': 1});
460
  });"
461
  );
462
  }
543
  if (!$this->disable_tracking($this->ga_standard_tracking_enabled)) {
544
  $inline_js = "ga('send', 'event', 'Enhanced-Ecommerce', 'pageview', 'footer',{'nonInteraction': 1})";
545
  } else {
546
+ $inline_js = "ga('send', 'event', 'Enhanced-Ecommerce', 'pageview', 'footer',{'nonInteraction': 1});";
547
  }
548
 
549
  if (version_compare($woocommerce->version, '2.1', '>=')) {
readme.txt CHANGED
@@ -1,14 +1,14 @@
1
- === Enhance E-Commerce Google Analytics Plugin for WooCommerce ===
2
  Contributors: Tatvic
3
- Plugin Name: Enhanced E-commerce for Woocommerce store
4
  Plugin URI:
5
  Tags: Google Analytics, Universal Analytics, Enhanced E-commerce, E-commerce, e-commerce, woo-commerce
6
  Author URI: http://www.tatvic.com/
7
  Author: Tatvic
8
  Requires at least: 3.6
9
  Tested up to: 3.8
10
- Stable tag: 1.0.4
11
- Version: 1.0.4
12
  License: GPLv3
13
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
14
 
1
+ === Enhance Ecommerce Google Analytics Plugin for WooCommerce ===
2
  Contributors: Tatvic
3
+ Plugin Name: Enhanced Ecommerce for Woocommerce store
4
  Plugin URI:
5
  Tags: Google Analytics, Universal Analytics, Enhanced E-commerce, E-commerce, e-commerce, woo-commerce
6
  Author URI: http://www.tatvic.com/
7
  Author: Tatvic
8
  Requires at least: 3.6
9
  Tested up to: 3.8
10
+ Stable tag: 1.0.5
11
+ Version: 1.0.5
12
  License: GPLv3
13
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
14