Skip to content

Commit

Permalink
Fix: wrong id parameter used in product variations
Browse files Browse the repository at this point in the history
  • Loading branch information
duracelltomi committed Mar 27, 2024
1 parent 5767eda commit 2acafeb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/gtm4wp-woocommerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,9 @@ function gtm4wp_woocommerce_process_pages() {

current_product_detail_data.price = gtm4wp_make_sure_is_float( current_product_detail_data.price );

current_product_detail_data.id = product_variation.variation_id;
current_product_detail_data.item_id = product_variation.variation_id;
if ( gtm4wp_use_sku_instead && product_variation.sku && ('' !== product_variation.sku) ) {
current_product_detail_data.id = product_variation.sku;
current_product_detail_data.item_id = product_variation.sku;
}
current_product_detail_data.price = gtm4wp_make_sure_is_float( product_variation.display_price );

Expand Down
10 changes: 9 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: google tag manager, tag manager, gtm, google, adwords, google adwords, goo
Requires at least: 3.4.0
Requires PHP: 7.4
Tested up to: 6.5
Stable tag: 1.20.1
Stable tag: 1.20.2
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl.html

Expand Down Expand Up @@ -224,6 +224,10 @@ to report micro conversions and/or to serve ads only to visitors who spend more

== Changelog ==

= 1.20.2 =

* Fix: Wrong ID parameter used tracking product variations (id instead of item_id). Thanks [micmaf](https://github.com/micmaf)

= 1.20.1 =

* Fix: do not load GTM container when OFF and console.log OFF. Thanks [morvy](https://github.com/morvy)
Expand Down Expand Up @@ -900,6 +904,10 @@ Please report all bugs found in my plugin using the [contact form on my website]

== Upgrade Notice ==

= 1.20.2 =

Bugfix release

= 1.20.1 =

Bugfix release
Expand Down

0 comments on commit 2acafeb

Please sign in to comment.