Changeset 3452830
- Timestamp:
- 02/03/2026 11:59:06 AM (8 weeks ago)
- Location:
- trackboxx-analytics/trunk
- Files:
-
- 2 added
- 4 edited
-
includes/class-trackboxx.php (modified) (1 diff)
-
public/class-trackboxx-public.php (modified) (3 diffs)
-
public/js (added)
-
public/js/trackboxx-public.js (added)
-
readme.txt (modified) (2 diffs)
-
trackboxx.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trackboxx-analytics/trunk/includes/class-trackboxx.php
r3404142 r3452830 187 187 // WooCommerce tracking hooks 188 188 $this->loader->add_action( 'woocommerce_before_thankyou', $plugin_public, 'wc_purchase_tracking_script' ); 189 $this->loader->add_action( 'woocommerce_add_to_cart', $plugin_public, 'wc_add_to_cart', 10, 2 );189 // $this->loader->add_action( 'woocommerce_add_to_cart', $plugin_public, 'wc_add_to_cart', 10, 2 ); 190 190 191 191 // New View Cart tracking hooks (added in version 1.3.34) 192 192 $this->loader->add_action( 'wp_footer', $plugin_public, 'wc_view_cart_tracking' ); 193 193 $this->loader->add_action( 'wp_footer', $plugin_public, 'wc_view_product_tracking' ); 194 $this->loader->add_filter( 'woocommerce_loop_add_to_cart_args', $plugin_public, 'wc_add_to_cart_args', 10, 2 ); 195 $this->loader->add_action( 'woocommerce_after_add_to_cart_button', $plugin_public, 'wc_after_add_to_cart_button' ); 194 196 } 195 197 -
trackboxx-analytics/trunk/public/class-trackboxx-public.php
r3404142 r3452830 114 114 // enqueue_scripts_old are fired on the same request. 115 115 $this->tb_output_loader( $trackboxx_id ); 116 117 wp_enqueue_script( 118 $this->plugin_name, 119 plugin_dir_url( __FILE__ ) . 'js/trackboxx-public.js', 120 array(), 121 $this->version, 122 array('in_footer' => true) 123 ); 116 124 } 117 125 … … 176 184 'content-type' => 'text/plain', 177 185 'user-agent' => $user_agent, 178 'X_FORWARDED_FOR' => $anonymized_ip ,186 'X_FORWARDED_FOR' => $anonymized_ip 179 187 ), 180 188 ); … … 267 275 } 268 276 } 277 278 /** 279 * Track WooCommerce AddToCart action. 280 * 281 * @return array 282 */ 283 public function wc_add_to_cart_args($args, $product) { 284 $trackboxx_context = array( 285 'action' => 'AddToCart', 286 'data' => array( 287 array( 288 'type' => 'AddToCart' 289 ), 290 array( 291 'type' => 'product', 292 'name' => $product->get_name(), 293 'price' => (float) $product->get_price() 294 ) 295 ) 296 ); 297 298 $args['attributes']['data-trackboxx-context'] = esc_attr( 299 wp_json_encode($trackboxx_context) 300 ); 301 302 return $args; 303 } 304 305 /** 306 * Track WooCommerce AddToCart action. 307 * 308 * @return void 309 */ 310 public function wc_after_add_to_cart_button() { 311 global $product; 312 313 $trackboxx_context = array( 314 'action' => 'AddToCart', 315 'data' => array( 316 array( 317 'type' => 'AddToCart' 318 ), 319 array( 320 'type' => 'product', 321 'name' => $product->get_name(), 322 'price' => (float) $product->get_price() 323 ) 324 ) 325 ); 326 327 echo '<input type="hidden" name="trackboxx_context" value="' . esc_attr( wp_json_encode( $trackboxx_context ) ) . '" />' . "\n"; 328 } 269 329 270 330 /** -
trackboxx-analytics/trunk/readme.txt
r3404142 r3452830 115 115 == Changelog == 116 116 117 118 = 1.3.34 = 117 = 1.4.0 = 119 118 * Added view cart tracking functionality for improved event accuracy. 120 119 * Added product view tracking to support enhanced behavioral analytics. … … 122 121 * Enables Trackboxx to calculate cart abandonment rates more reliably. 123 122 * Updated public classes and loader to include new tracking hooks. 123 124 = 1.3.34 = 125 * Bugfixing Onboarding Process 126 124 127 125 128 = 1.3.33 = -
trackboxx-analytics/trunk/trackboxx.php
r3404142 r3452830 5 5 * Author: Trackboxx 6 6 * Author URI: https://trackboxx.com/ 7 * Version: 1. 3.347 * Version: 1.4.0 8 8 * Requires PHP: 8.0 9 9 * Text Domain: trackboxx-analytics … … 23 23 * Currently plugin version. 24 24 */ 25 define( 'TRACKBOXX_VERSION', '1. 3.34' );25 define( 'TRACKBOXX_VERSION', '1.4.0' ); 26 26 27 27
Note: See TracChangeset
for help on using the changeset viewer.