Changeset 3348467
- Timestamp:
- 08/22/2025 06:36:25 AM (7 months ago)
- Location:
- gtm-kit
- Files:
-
- 14 edited
- 1 copied
-
tags/2.5.1 (copied) (copied from gtm-kit/trunk)
-
tags/2.5.1/changelog.txt (modified) (1 diff)
-
tags/2.5.1/gtm-kit.php (modified) (3 diffs)
-
tags/2.5.1/languages/gtm-kit.pot (modified) (2 diffs)
-
tags/2.5.1/readme.txt (modified) (2 diffs)
-
tags/2.5.1/src/Frontend/Frontend.php (modified) (1 diff)
-
tags/2.5.1/src/Integration/WooCommerce.php (modified) (6 diffs)
-
tags/2.5.1/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/gtm-kit.php (modified) (3 diffs)
-
trunk/languages/gtm-kit.pot (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Frontend/Frontend.php (modified) (1 diff)
-
trunk/src/Integration/WooCommerce.php (modified) (6 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gtm-kit/tags/2.5.1/changelog.txt
r3339414 r3348467 1 1 *** GTM Kit *** 2 3 2025-08-2 - version 2.5.1 4 * Fix: Force rounding values to 2 decimal places to fix rounding issues in edge cases. 5 * Fix: In some cases the GTM container would not load after activating and deactivating settings in 'Server-side Tagging (sGTM)'. 6 * Dev: Tested up to WooCommerce 10.1. 2 7 3 8 2025-08-05 - version 2.5.0 -
gtm-kit/tags/2.5.1/gtm-kit.php
r3339414 r3348467 4 4 * 5 5 * Plugin Name: GTM Kit 6 * Version: 2.5. 06 * Version: 2.5.1 7 7 * Plugin URI: https://gtmkit.com/ 8 8 * Description: Google Tag Manager implementation focusing on flexibility and pagespeed. … … 16 16 * 17 17 * WC requires at least: 9.0 18 * WC tested up to: 10. 018 * WC tested up to: 10.1 19 19 * 20 20 * @package GTM Kit … … 28 28 } 29 29 30 const GTMKIT_VERSION = '2.5. 0';30 const GTMKIT_VERSION = '2.5.1'; 31 31 32 32 if ( ! defined( 'GTMKIT_FILE' ) ) { -
gtm-kit/tags/2.5.1/languages/gtm-kit.pot
r3339414 r3348467 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: GTM Kit 2.5. 0\n"5 "Project-Id-Version: GTM Kit 2.5.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gtm-kit\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-08- 03T18:31:37+00:00\n"12 "POT-Creation-Date: 2025-08-21T14:07:08+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.9.0\n" -
gtm-kit/tags/2.5.1/readme.txt
r3339414 r3348467 4 4 Tags: google tag manager, gtm, woocommerce, analytics, ga4 5 5 Tested up to: 6.8 6 Stable tag: 2.5. 06 Stable tag: 2.5.1 7 7 License: GPLv3 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 97 97 == Changelog == 98 98 99 = 2.5.1 = 100 101 Release date: 2025-08-22 102 103 #### Bugfixes: 104 * Force rounding values to 2 decimal places to fix rounding issues in edge cases. 105 * In some cases the GTM container would not load after activating and deactivating settings in 'Server-side Tagging (sGTM)'. 106 107 #### Other: 108 * Tested up to WooCommerce 10.1. 109 99 110 = 2.5.0 = 100 111 -
gtm-kit/tags/2.5.1/src/Frontend/Frontend.php
r3266155 r3348467 209 209 public function get_gtm_script( string $gtm_id ): void { 210 210 $domain = $this->options->get( 'general', 'sgtm_domain' ) ? $this->options->get( 'general', 'sgtm_domain' ) : 'www.googletagmanager.com'; 211 $loader = $this->options->get( 'general', 'sgtm_container_identifier') ? $this->options->get( 'general', 'sgtm_container_identifier' ) : 'gtm';212 213 if ( $ this->options->get( 'general', 'sgtm_cookie_keeper' ) ) {211 $loader = ! empty( $this->options->get( 'general', 'sgtm_container_identifier' ) ) ? $this->options->get( 'general', 'sgtm_container_identifier' ) : 'gtm'; 212 213 if ( $domain !== 'www.googletagmanager.com' && $loader !== 'gtm' && $this->options->get( 'general', 'sgtm_cookie_keeper' ) ) { 214 214 $gtm_id = preg_replace( '/^GTM\-/i', '', $gtm_id ); 215 215 echo "/* Google Tag Manager with Stape.io Cookie Keeper */\n"; -
gtm-kit/tags/2.5.1/src/Integration/WooCommerce.php
r3284597 r3348467 307 307 if ( is_checkout() && ! is_order_received_page() ) { 308 308 $global_data['wc']['cart_items'] = $this->get_cart_items( 'begin_checkout' ); 309 $global_data['wc']['cart_value'] = (float) wc_prices_include_tax() ? WC()->cart->get_cart_contents_total() + WC()->cart->get_cart_contents_tax() : WC()->cart->get_cart_contents_total();309 $global_data['wc']['cart_value'] = round( wc_prices_include_tax() ? ( WC()->cart->get_cart_contents_total() + WC()->cart->get_cart_contents_tax() ) : WC()->cart->get_cart_contents_total(), 2 ); 310 310 $global_data['wc']['chosen_shipping_method'] = WC()->session->get( 'chosen_shipping_methods' )[0] ?? ''; 311 311 $global_data['wc']['chosen_payment_method'] = $this->get_payment_method(); … … 398 398 $data_layer['ecommerce'] = [ 399 399 'items' => [ $item ], 400 'value' => (float) $item['price'],400 'value' => round( $item['price'], 2 ), 401 401 'currency' => $this->store_currency, 402 402 ]; … … 459 459 $data_layer['ecommerce'] = [ 460 460 'currency' => $this->store_currency, 461 'value' => (float) $cart_value,461 'value' => round( $cart_value, 2 ), 462 462 'items' => $this->get_cart_items( 'view_cart' ), 463 463 ]; … … 487 487 $data_layer['event'] = 'begin_checkout'; 488 488 $data_layer['ecommerce']['currency'] = $this->store_currency; 489 $data_layer['ecommerce']['value'] = (float) $cart_value;489 $data_layer['ecommerce']['value'] = round( $cart_value, 2 ); 490 490 491 491 $coupons = WC()->cart->get_applied_coupons(); … … 595 595 $data_layer['ecommerce'] = [ 596 596 'transaction_id' => (string) $order->get_order_number(), 597 'value' => (float) $order_value,598 'tax' => (float) $order->get_total_tax(),599 'shipping' => (float) $shipping_total,597 'value' => round( $order_value, 2 ), 598 'tax' => round( $order->get_total_tax(), 2 ), 599 'shipping' => round( $shipping_total, 2 ), 600 600 'currency' => $order->get_currency(), 601 601 ]; … … 1187 1187 1188 1188 $data_layer['ecommerce']['customer']['order_count'] = $order_count; 1189 $data_layer['ecommerce']['customer']['total_spent'] = (float) $total_spent;1189 $data_layer['ecommerce']['customer']['total_spent'] = round( $total_spent, 2 ); 1190 1190 1191 1191 $data_layer['ecommerce']['customer']['first_name'] = $wc_customer->get_first_name(); -
gtm-kit/tags/2.5.1/vendor/composer/installed.php
r3339414 r3348467 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 5ea8688e7048f73584022140e91d7e7fa72d09d9',6 'reference' => 'b14aa9d2723fe466e692a8805879f41bfacffd50', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' 5ea8688e7048f73584022140e91d7e7fa72d09d9',16 'reference' => 'b14aa9d2723fe466e692a8805879f41bfacffd50', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../', -
gtm-kit/trunk/changelog.txt
r3339414 r3348467 1 1 *** GTM Kit *** 2 3 2025-08-2 - version 2.5.1 4 * Fix: Force rounding values to 2 decimal places to fix rounding issues in edge cases. 5 * Fix: In some cases the GTM container would not load after activating and deactivating settings in 'Server-side Tagging (sGTM)'. 6 * Dev: Tested up to WooCommerce 10.1. 2 7 3 8 2025-08-05 - version 2.5.0 -
gtm-kit/trunk/gtm-kit.php
r3339414 r3348467 4 4 * 5 5 * Plugin Name: GTM Kit 6 * Version: 2.5. 06 * Version: 2.5.1 7 7 * Plugin URI: https://gtmkit.com/ 8 8 * Description: Google Tag Manager implementation focusing on flexibility and pagespeed. … … 16 16 * 17 17 * WC requires at least: 9.0 18 * WC tested up to: 10. 018 * WC tested up to: 10.1 19 19 * 20 20 * @package GTM Kit … … 28 28 } 29 29 30 const GTMKIT_VERSION = '2.5. 0';30 const GTMKIT_VERSION = '2.5.1'; 31 31 32 32 if ( ! defined( 'GTMKIT_FILE' ) ) { -
gtm-kit/trunk/languages/gtm-kit.pot
r3339414 r3348467 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: GTM Kit 2.5. 0\n"5 "Project-Id-Version: GTM Kit 2.5.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gtm-kit\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-08- 03T18:31:37+00:00\n"12 "POT-Creation-Date: 2025-08-21T14:07:08+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.9.0\n" -
gtm-kit/trunk/readme.txt
r3339414 r3348467 4 4 Tags: google tag manager, gtm, woocommerce, analytics, ga4 5 5 Tested up to: 6.8 6 Stable tag: 2.5. 06 Stable tag: 2.5.1 7 7 License: GPLv3 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 97 97 == Changelog == 98 98 99 = 2.5.1 = 100 101 Release date: 2025-08-22 102 103 #### Bugfixes: 104 * Force rounding values to 2 decimal places to fix rounding issues in edge cases. 105 * In some cases the GTM container would not load after activating and deactivating settings in 'Server-side Tagging (sGTM)'. 106 107 #### Other: 108 * Tested up to WooCommerce 10.1. 109 99 110 = 2.5.0 = 100 111 -
gtm-kit/trunk/src/Frontend/Frontend.php
r3266155 r3348467 209 209 public function get_gtm_script( string $gtm_id ): void { 210 210 $domain = $this->options->get( 'general', 'sgtm_domain' ) ? $this->options->get( 'general', 'sgtm_domain' ) : 'www.googletagmanager.com'; 211 $loader = $this->options->get( 'general', 'sgtm_container_identifier') ? $this->options->get( 'general', 'sgtm_container_identifier' ) : 'gtm';212 213 if ( $ this->options->get( 'general', 'sgtm_cookie_keeper' ) ) {211 $loader = ! empty( $this->options->get( 'general', 'sgtm_container_identifier' ) ) ? $this->options->get( 'general', 'sgtm_container_identifier' ) : 'gtm'; 212 213 if ( $domain !== 'www.googletagmanager.com' && $loader !== 'gtm' && $this->options->get( 'general', 'sgtm_cookie_keeper' ) ) { 214 214 $gtm_id = preg_replace( '/^GTM\-/i', '', $gtm_id ); 215 215 echo "/* Google Tag Manager with Stape.io Cookie Keeper */\n"; -
gtm-kit/trunk/src/Integration/WooCommerce.php
r3284597 r3348467 307 307 if ( is_checkout() && ! is_order_received_page() ) { 308 308 $global_data['wc']['cart_items'] = $this->get_cart_items( 'begin_checkout' ); 309 $global_data['wc']['cart_value'] = (float) wc_prices_include_tax() ? WC()->cart->get_cart_contents_total() + WC()->cart->get_cart_contents_tax() : WC()->cart->get_cart_contents_total();309 $global_data['wc']['cart_value'] = round( wc_prices_include_tax() ? ( WC()->cart->get_cart_contents_total() + WC()->cart->get_cart_contents_tax() ) : WC()->cart->get_cart_contents_total(), 2 ); 310 310 $global_data['wc']['chosen_shipping_method'] = WC()->session->get( 'chosen_shipping_methods' )[0] ?? ''; 311 311 $global_data['wc']['chosen_payment_method'] = $this->get_payment_method(); … … 398 398 $data_layer['ecommerce'] = [ 399 399 'items' => [ $item ], 400 'value' => (float) $item['price'],400 'value' => round( $item['price'], 2 ), 401 401 'currency' => $this->store_currency, 402 402 ]; … … 459 459 $data_layer['ecommerce'] = [ 460 460 'currency' => $this->store_currency, 461 'value' => (float) $cart_value,461 'value' => round( $cart_value, 2 ), 462 462 'items' => $this->get_cart_items( 'view_cart' ), 463 463 ]; … … 487 487 $data_layer['event'] = 'begin_checkout'; 488 488 $data_layer['ecommerce']['currency'] = $this->store_currency; 489 $data_layer['ecommerce']['value'] = (float) $cart_value;489 $data_layer['ecommerce']['value'] = round( $cart_value, 2 ); 490 490 491 491 $coupons = WC()->cart->get_applied_coupons(); … … 595 595 $data_layer['ecommerce'] = [ 596 596 'transaction_id' => (string) $order->get_order_number(), 597 'value' => (float) $order_value,598 'tax' => (float) $order->get_total_tax(),599 'shipping' => (float) $shipping_total,597 'value' => round( $order_value, 2 ), 598 'tax' => round( $order->get_total_tax(), 2 ), 599 'shipping' => round( $shipping_total, 2 ), 600 600 'currency' => $order->get_currency(), 601 601 ]; … … 1187 1187 1188 1188 $data_layer['ecommerce']['customer']['order_count'] = $order_count; 1189 $data_layer['ecommerce']['customer']['total_spent'] = (float) $total_spent;1189 $data_layer['ecommerce']['customer']['total_spent'] = round( $total_spent, 2 ); 1190 1190 1191 1191 $data_layer['ecommerce']['customer']['first_name'] = $wc_customer->get_first_name(); -
gtm-kit/trunk/vendor/composer/installed.php
r3339414 r3348467 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 5ea8688e7048f73584022140e91d7e7fa72d09d9',6 'reference' => 'b14aa9d2723fe466e692a8805879f41bfacffd50', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' 5ea8688e7048f73584022140e91d7e7fa72d09d9',16 'reference' => 'b14aa9d2723fe466e692a8805879f41bfacffd50', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.