DuracellTomi's Google Tag Manager for WordPress - Version 1.5.1

Version Description

Fixed: clicks on products in product list pages redirected to undefined URLs with some themes.

Download this release

Release Info

Developer duracelltomi
Plugin Icon 128x128 DuracellTomi's Google Tag Manager for WordPress
Version 1.5.1
Comparing to
See all releases

Code changes from version 1.5 to 1.5.1

duracelltomi-google-tag-manager-for-wordpress.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Google Tag Manager for Wordpress
4
- Version: 1.5
5
  Plugin URI: https://duracelltomi.com/google-tag-manager-for-wordpress/
6
  Description: The first Google Tag Manager plugin for WordPress with business goals in mind
7
  Author: Thomas Geiger
@@ -10,7 +10,7 @@ Text Domain: duracelltomi-google-tag-manager
10
  Domain Path: /languages
11
  */
12
 
13
- define( 'GTM4WP_VERSION', '1.5' );
14
  define( 'GTM4WP_PATH', plugin_dir_path( __FILE__ ) );
15
 
16
  $gtp4wp_plugin_url = plugin_dir_url( __FILE__ );
1
  <?php
2
  /*
3
  Plugin Name: Google Tag Manager for Wordpress
4
+ Version: 1.5.1
5
  Plugin URI: https://duracelltomi.com/google-tag-manager-for-wordpress/
6
  Description: The first Google Tag Manager plugin for WordPress with business goals in mind
7
  Author: Thomas Geiger
10
  Domain Path: /languages
11
  */
12
 
13
+ define( 'GTM4WP_VERSION', '1.5.1' );
14
  define( 'GTM4WP_PATH', plugin_dir_path( __FILE__ ) );
15
 
16
  $gtp4wp_plugin_url = plugin_dir_url( __FILE__ );
integration/woocommerce.php CHANGED
@@ -600,16 +600,26 @@ function gtm4wp_woocommerce_enhanced_ecom_product_click() {
600
  gtm4wp_woocommerce_addjs("
601
  $( '.products li:not(.product-category) a:not(.add_to_cart_button),.widget-product-item' ).click(function( event ) {
602
  var _productdata = $( this ).closest( '.product' );
 
603
  if ( _productdata.length > 0 ) {
604
  var productdata = _productdata.find( '.gtm4wp_productdata' );
 
605
  } else {
606
- var productdata = jQuery( this );
 
 
 
 
 
 
607
 
608
- if ( '' == productdata.data( 'gtm4wp_product_id' ) ) {
609
- return true;
610
  }
611
  }
612
 
 
 
 
 
613
  var ctrl_key_pressed = event.ctrlKey;
614
 
615
  event.preventDefault();
600
  gtm4wp_woocommerce_addjs("
601
  $( '.products li:not(.product-category) a:not(.add_to_cart_button),.widget-product-item' ).click(function( event ) {
602
  var _productdata = $( this ).closest( '.product' );
603
+
604
  if ( _productdata.length > 0 ) {
605
  var productdata = _productdata.find( '.gtm4wp_productdata' );
606
+
607
  } else {
608
+ var _productdata = $( this ).closest( 'ul.products li' );
609
+
610
+ if ( _productdata.length > 0 ) {
611
+ var productdata = _productdata.find( '.gtm4wp_productdata' );
612
+
613
+ } else {
614
+ var productdata = jQuery( this );
615
 
 
 
616
  }
617
  }
618
 
619
+ if ( ( 'undefined' == typeof productdata.data( 'gtm4wp_product_id' ) ) || ( '' == productdata.data( 'gtm4wp_product_id' ) ) ) {
620
+ return true;
621
+ }
622
+
623
  var ctrl_key_pressed = event.ctrlKey;
624
 
625
  event.preventDefault();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://duracelltomi.com/
4
  Tags: google tag manager, tag manager, gtm, google, adwords, google adwords, adwords remarketing, remarketing, google analytics, analytics, facebook ads, facebook remarketing, facebook pixel
5
  Requires at least: 3.4.0
6
  Tested up to: 4.6.1
7
- Stable tag: 1.5.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
@@ -271,6 +271,10 @@ If you or your social plugin inserts the Facebook buttons using IFRAMEs (like So
271
 
272
  == Changelog ==
273
 
 
 
 
 
274
  = 1.5 =
275
 
276
  Lots of WooCommerce ecommerce codes has been changed and extended, please double check your measurement after upgrading to this version!
@@ -466,6 +470,10 @@ Please report all bugs found in my plugin using the [contact form on my website]
466
 
467
  == Upgrade Notice ==
468
 
 
 
 
 
469
  = 1.5 =
470
 
471
  Lots of WooCommerce ecommerce codes has been changed and extended, please double check your measurement after upgrading to this version!
4
  Tags: google tag manager, tag manager, gtm, google, adwords, google adwords, adwords remarketing, remarketing, google analytics, analytics, facebook ads, facebook remarketing, facebook pixel
5
  Requires at least: 3.4.0
6
  Tested up to: 4.6.1
7
+ Stable tag: 1.5.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
271
 
272
  == Changelog ==
273
 
274
+ = 1.5.1 =
275
+
276
+ Fixed: clicks on products in product list pages redirected to undefined URLs with some themes.
277
+
278
  = 1.5 =
279
 
280
  Lots of WooCommerce ecommerce codes has been changed and extended, please double check your measurement after upgrading to this version!
470
 
471
  == Upgrade Notice ==
472
 
473
+ = 1.5.1 =
474
+
475
+ Fixed: clicks on products in product list pages redirected to undefined URLs with some themes.
476
+
477
  = 1.5 =
478
 
479
  Lots of WooCommerce ecommerce codes has been changed and extended, please double check your measurement after upgrading to this version!