Changeset 3309746
- Timestamp:
- 06/11/2025 11:21:57 AM (8 months ago)
- Location:
- customerlabs-actionrecorder
- Files:
-
- 8 edited
- 6 copied
-
tags/1.9.2 (copied) (copied from customerlabs-actionrecorder/trunk)
-
tags/1.9.2/ActionRecorder.php (copied) (copied from customerlabs-actionrecorder/trunk/ActionRecorder.php) (2 diffs)
-
tags/1.9.2/Readme.md (copied) (copied from customerlabs-actionrecorder/trunk/Readme.md) (6 diffs)
-
tags/1.9.2/Readme.txt (copied) (copied from customerlabs-actionrecorder/trunk/Readme.txt) (7 diffs)
-
tags/1.9.2/class.cltracker-cookie.php (copied) (copied from customerlabs-actionrecorder/trunk/class.cltracker-cookie.php) (4 diffs)
-
tags/1.9.2/integrations/ecommerce/woocommerce.php (modified) (3 diffs)
-
tags/1.9.2/templates/1pd_cookie.php (copied) (copied from customerlabs-actionrecorder/trunk/templates/1pd_cookie.php)
-
tags/1.9.2/templates/track.php (modified) (3 diffs)
-
trunk/ActionRecorder.php (modified) (2 diffs)
-
trunk/Readme.md (modified) (6 diffs)
-
trunk/Readme.txt (modified) (7 diffs)
-
trunk/class.cltracker-cookie.php (modified) (4 diffs)
-
trunk/integrations/ecommerce/woocommerce.php (modified) (3 diffs)
-
trunk/templates/track.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
customerlabs-actionrecorder/tags/1.9.2/ActionRecorder.php
r3141407 r3309746 3 3 Plugin Name: WooCommerce Conversion Tracking 4 4 Description: A simple implementation of e-commerce events tracking for Wordpress 5 Version: 1.9. 15 Version: 1.9.2 6 6 License: GPLv2 7 7 Author: CustomerLabs Digital Solutions Pvt. Ltd. … … 272 272 */ 273 273 public function plugin_action_links( $links, $file ) { 274 error_log(print_r($links, true));275 274 // Not for other plugins, silly. NOTE: This doesn't work properly when 276 275 // the plugin for testing is a symlink!! If you change this, test it. -
customerlabs-actionrecorder/tags/1.9.2/Readme.md
r3141407 r3309746 3 3 Tags: WooCommerce Conversion Tracking, WooCommerce Conversion Tracking Google Ads, WooCommerce Conversion Tracking GA4, WooCommerce Meta Ads Conversions API, WooCommerce event tracking, WooCommerce track events 4 4 Requires at least: 5.0 5 Tested up to: 6. 6.16 Stable tag: 1.9. 15 Tested up to: 6.8.1 6 Stable tag: 1.9.2 7 7 Requires PHP: 7.0 8 8 License: GPLv2 … … 14 14 15 15 CustomerLabs plugin is one of the best WooCommerce plugins to track conversion events on your WooCommerce store, and send it to Ad platforms seamlessly. This plugin goes beyond conversion tracking and establishes a robust connection of your WooCommerce store with ad platforms. 16 17 🔒 **Enhanced Security**: Version 1.9.2 includes comprehensive security improvements with CSRF protection, enhanced access controls, and secure cookie handling to ensure your data is protected. 16 18 17 19 ### With the automatic event tracking for your WooCommerce store by [CustomerLabs](https://customerlabs.com/), you can track … … 42 44 * Connect WhatsApp 43 45 * Sync the data with BigQuery for detailed analysis of your data, creating custom reports and more 46 * **Enhanced security features** with CSRF protection and secure cookie handling 44 47 45 48 … … 56 59 * Helps activate anonymous website visitors 57 60 * ROI positive implementation 61 * **Secure and compliant** with WordPress security best practices 58 62 59 63 … … 77 81 That's it! You can now turn on any Destinations in CustomerLabs CDP Destinations section. 78 82 83 ## Security 84 85 Version 1.9.2 includes comprehensive security enhancements: 86 - **CSRF Protection**: All AJAX endpoints are protected with nonce verification 87 - **Enhanced Access Controls**: Improved input validation and sanitization 88 - **Secure Cookie Handling**: Proper security flags for cookie protection 89 - **WordPress Security Compliance**: Follows WordPress security best practices 90 - **Information Protection**: Removed debug code to prevent data leakage 91 79 92 ## Frequently Asked Questions 80 93 81 - Is CustomerLabs Plugin for WooCommerce Conversion Tracking Free? = 94 **Is CustomerLabs Plugin for WooCommerce Conversion Tracking Free?** 82 95 83 96 Yes. CustomerLabs plugin for WooCommerce Conversion Tracking is a free plugin on WordPress for your WooCommerce store. However, you would need CustomerLabs account to leverage the plugin 84 97 85 - Is CustomerLabs WooCommerce Conversion Tracking on the server-side? = 98 **Is CustomerLabs WooCommerce Conversion Tracking on the server-side?** 86 99 87 100 CustomerLabs offers a robust 1P domain tracking or the first-party domain that helps you set first-party cookies that stay for almost a lifetime. You can leverage it to reinforce your WooCommerce store conversion tracking efforts, and get a complete customer journey without any signal loss. 88 101 89 - Does CustomerLabs plugin offer WooCommerce Conversion Tracking for Google Ads? = 102 **Does CustomerLabs plugin offer WooCommerce Conversion Tracking for Google Ads?** 90 103 91 104 Yes. CustomerLabs free plugin offers direct and seamless integration with Google Ads, helping you with WooCommerce Conversion Tracking in Google Ads. 92 105 93 - Does CustomerLabs plugin offer WooCommerce Conversions API for Meta Ads? = 106 **Does CustomerLabs plugin offer WooCommerce Conversions API for Meta Ads?** 94 107 95 108 CustomerLabs plugin offers one click integration of data from your website to Meta Ads through Conversions API. The entire technology is robust that would help you mitigate signal loss to Meta Ads. 96 109 97 98 - Does CustomerLabs plugin offer WooCommerce Conversion Tracking for GA4? = 110 **Does CustomerLabs plugin offer WooCommerce Conversion Tracking for GA4?** 99 111 100 112 WooCommerce conversion tracking in GA4 is essential for marketers, and CustomerLabs offers GA4 integration for your store through Google Measurement Protocol (GMP) sending all the data on the server-side with just a few clicks. 101 113 102 - Why is CustomerLabs the best plugin for WooCommerce stores? = 114 **Is the plugin secure?** 115 116 Yes, version 1.9.2 includes comprehensive security enhancements including CSRF protection, secure cookie handling, enhanced access controls, and follows WordPress security best practices to protect your data. 117 118 **Why is CustomerLabs the best plugin for WooCommerce stores?** 103 119 104 120 CustomerLabs plugin offers one-stop solution for tracking all conversions including custom conversions for your WooCommerce stores and send the conversion tracking data across to any platform such as GA4, Google Ads, Meta Ads, LinkedIn Ads, and more, with just a few clicks! It offers consent mode v2 for Google Ads, and a centralized consent triggers for all marketing platforms from a single space. It goes beyond conversion tracking and offers synthetic event optimization. To know more, reach out to our experts and get a free 1PD OPs consultation [here](http://customerlabs.com/request-a-demo/) … … 111 127 ## Changelog 112 128 113 = 1.9.1 = 129 **1.9.2** 130 * Security Enhancement - Implemented comprehensive security improvements 131 * Security Enhancement - Added CSRF protection with nonce verification 132 * Security Enhancement - Enhanced access controls and input validation 133 * Security Enhancement - Improved cookie security with proper flags 134 * Security Enhancement - Removed debug code to prevent information disclosure 135 * Security Enhancement - Follows WordPress security best practices 136 * Bug Fix - Improved error handling and sanitization 137 138 **1.9.1** 114 139 * Bug Fix - fixed cookie set on cashed pages 115 140 116 = 1.9.0 = 141 **1.9.0** 117 142 * Server side cookie tracking - user_id implementation 118 143 119 = 1.8.2 = 144 **1.8.2** 120 145 * README.md updated 121 146 122 = 1.8.1 = 147 **1.8.1** 123 148 * Javascript variable conflict on cookie update 124 149 125 = 1.8.0 = 150 **1.8.0** 126 151 * Plugin name changed from Action Recorder -> Customerlabs CDP 127 152 128 = 1.7.0 = 153 **1.7.0** 129 154 * Plugin tested upto latest version of WordPress-6.1.1 130 155 131 = 1.6.0 = 156 **1.6.0** 132 157 * Handled duplicate purchase event triggers 133 158 134 = 1.5.0 = 159 **1.5.0** 135 160 * Cookies values contains plus instead of space issue fixed 136 161 137 = 1.4.0 = 162 **1.4.0** 138 163 * Handling ajax triggers from frontend for add_to_cart and remove_from_cart 139 164 140 = 1.3.1 = 165 **1.3.1** 141 166 * Removed user traits from "User Signed Up" and "User Logged In" events 142 167 143 = 1.3.0 = 168 **1.3.0** 144 169 * Fixed multiple ajax events 145 170 * Fixed multiple events tracking on page load 146 171 147 = 1.2.1 = 172 **1.2.1** 148 173 * Bug Fix settings update issue 149 174 150 = 1.2.0 = 175 **1.2.0** 151 176 * Added search event tracking 152 177 153 = 1.1.0 = 178 **1.1.0** 154 179 * woocommerce tracking 155 180 156 = 1.0.0 = 181 **1.0.0** 157 182 * Initial release! 158 183 159 184 ## Upgrade Notice 160 185 161 = 1.9.1 = 186 **1.9.2** 187 IMPORTANT SECURITY UPDATE: This version includes critical security enhancements including CSRF protection, enhanced access controls, and secure cookie handling. Update immediately for improved security and protection. 188 189 **1.9.1** 162 190 Bug Fix - fixed cookie set on cashed pages 163 191 164 = 1.9.0 = 192 **1.9.0** 165 193 Server side cookie tracking - user_id implementation 166 194 167 = 1.8.2 = 195 **1.8.2** 168 196 README.md updated 169 197 170 = 1.8.1 = 198 **1.8.1** 171 199 Javascript variable conflict on cookie update 172 200 173 = 1.8.0 = 201 **1.8.0** 174 202 Plugin name changed from Action Recorder -> Customerlabs CDP 175 203 176 = 1.7.0 = 204 **1.7.0** 177 205 Plugin tested upto latest version of WordPress-6.1.1 178 206 179 = 1.6.0 = 207 **1.6.0** 180 208 Handled duplicate purchase event triggers 181 209 182 = 1.5.0 = 210 **1.5.0** 183 211 Cookies values contains plus instead of space issue fixed 184 212 185 = 1.4.0 = 213 **1.4.0** 186 214 Handling ajax triggers from frontend for add_to_cart and remove_from_cart 187 215 188 = 1.3.1 = 216 **1.3.1** 189 217 Removed user traits from "User Signed Up" and "User Logged In" events 190 218 191 = 1.3.0 = 219 **1.3.0** 192 220 Fixed multiple ajax events 193 221 Fixed multiple events tracking on page load 194 222 195 = 1.2.1 = 223 **1.2.1** 196 224 Bug Fix settings update issue 197 225 198 = 1.2.0 = 226 **1.2.0** 199 227 Added search event tracking 200 201 = 1.1.0 =202 Supports woocommerce integration203 204 = 1.0 =205 Just released into the wild. -
customerlabs-actionrecorder/tags/1.9.2/Readme.txt
r3141407 r3309746 3 3 Tags: WooCommerce Conversion Tracking, WooCommerce Conversion Tracking Google Ads, WooCommerce Conversion Tracking GA4, WooCommerce Meta Ads Conversions API, WooCommerce event tracking, WooCommerce track events 4 4 Requires at least: 5.0 5 Tested up to: 6. 6.16 Stable tag: 1.9. 15 Tested up to: 6.8.1 6 Stable tag: 1.9.2 7 7 Requires PHP: 7.0 8 8 License: GPLv2 … … 14 14 15 15 CustomerLabs plugin is one of the best WooCommerce plugins to track conversion events on your WooCommerce store, and send it to Ad platforms seamlessly. This plugin goes beyond conversion tracking and establishes a robust connection of your WooCommerce store with ad platforms. 16 17 🔒 **Enhanced Security**: Version 1.9.2 includes comprehensive security improvements with CSRF protection, enhanced access controls, and secure cookie handling to ensure your data is protected. 16 18 17 19 ### With the automatic event tracking for your WooCommerce store by [CustomerLabs](https://customerlabs.com/), you can track … … 42 44 * Connect WhatsApp 43 45 * Sync the data with BigQuery for detailed analysis of your data, creating custom reports and more 46 * **Enhanced security features** with CSRF protection and secure cookie handling 44 47 45 48 … … 56 59 * Helps activate anonymous website visitors 57 60 * ROI positive implementation 61 * **Secure and compliant** with WordPress security best practices 58 62 59 63 … … 85 89 WooCommerce conversion tracking in GA4 is essential for marketers, and CustomerLabs offers GA4 integration for your store through Google Measurement Protocol (GMP) sending all the data on the server-side with just a few clicks. 86 90 91 = Is the plugin secure? = 92 Yes, version 1.9.2 includes comprehensive security enhancements including CSRF protection, secure cookie handling, enhanced access controls, and follows WordPress security best practices to protect your data. 93 87 94 = Why is CustomerLabs the best plugin for WooCommerce stores? = 88 95 CustomerLabs plugin offers one-stop solution for tracking all conversions including custom conversions for your WooCommerce stores and send the conversion tracking data across to any platform such as GA4, Google Ads, Meta Ads, LinkedIn Ads, and more, with just a few clicks! It offers consent mode v2 for Google Ads, and a centralized consent triggers for all marketing platforms from a single space. It goes beyond conversion tracking and offers synthetic event optimization. To know more, reach out to our experts and get a free 1PD OPs consultation [here](http://customerlabs.com/request-a-demo/) … … 94 101 95 102 == Changelog == 103 104 = 1.9.2 = 105 * Security Enhancement - Implemented comprehensive security improvements 106 * Security Enhancement - Added CSRF protection with nonce verification 107 * Security Enhancement - Enhanced access controls and input validation 108 * Security Enhancement - Improved cookie security with proper flags 109 * Security Enhancement - Removed debug code to prevent information disclosure 110 * Security Enhancement - Follows WordPress security best practices 111 * Bug Fix - Improved error handling and sanitization 96 112 97 113 = 1.9.1 = … … 143 159 == Upgrade Notice == 144 160 161 = 1.9.2 = 162 IMPORTANT SECURITY UPDATE: This version includes critical security enhancements including CSRF protection, enhanced access controls, and secure cookie handling. Update immediately for improved security and protection. 163 145 164 = 1.9.1 = 146 165 Bug Fix - fixed cookie set on cashed pages -
customerlabs-actionrecorder/tags/1.9.2/class.cltracker-cookie.php
r3141407 r3309746 15 15 * @param string $key Name of the cookie 16 16 * @param string $value Value of the cookie 17 * @param bool $httponly Whether cookie should be httponly (default false for tracking cookies) 17 18 * 18 19 * @since 1.0.0 19 20 * 20 21 */ 21 public static function set_cookie( $key, $value ) { 22 @ setrawcookie( 'cltracker_' . $key . '_' . COOKIEHASH, rawurlencode($value), time() + DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); 22 public static function set_cookie( $key, $value, $httponly = false ) { 23 // Set secure cookie with appropriate flags 24 $secure = is_ssl(); 25 // Most tracking cookies need JavaScript access, so httponly is optional 26 @ setrawcookie( 'cltracker_' . $key . '_' . COOKIEHASH, rawurlencode($value), time() + DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, $secure, $httponly ); 23 27 $_COOKIE[ 'cltracker_' . $key . '_' . COOKIEHASH ] = $value; 24 28 } … … 64 68 } 65 69 66 print_r($set);70 // Removed debug print_r that was leaking information 67 71 68 72 if (!$set) { … … 83 87 public static function unset_cookie( $key = '' ) { 84 88 89 // Verify nonce for CSRF protection 90 if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'cltracker_nonce')) { 91 wp_send_json_error('Security check failed'); 92 wp_die(); 93 } 94 85 95 if ( isset( $_POST['key'] ) ) { 86 96 $key = sanitize_text_field( $_POST['key'] ); 87 97 } 88 98 89 @ setcookie( 'cltracker_' . $key . '_' . COOKIEHASH, '', time() - DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); 99 // Enhanced key validation 100 if (empty($key) || !preg_match('/^[a-zA-Z0-9_]+$/', $key)) { 101 wp_send_json_error('Invalid key format'); 102 wp_die(); 103 } 104 105 // Set secure cookie deletion - no httponly needed for deletion 106 $secure = is_ssl(); 107 @ setcookie( 'cltracker_' . $key . '_' . COOKIEHASH, '', time() - DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, $secure, false ); 90 108 unset( $_COOKIE[ 'cltracker_' . $key . '_' . COOKIEHASH ] ); 91 109 92 wp_send_json_success( $key ); 110 wp_send_json_success( 'Cookie cleared successfully' ); 111 wp_die(); 93 112 } 94 113 … … 99 118 */ 100 119 public static function set_unique_user_id_cookie() { 120 // Verify nonce for CSRF protection 121 if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'cltracker_nonce')) { 122 wp_send_json_error('Security check failed'); 123 wp_die(); 124 } 125 101 126 $settings = CLTracker_Wordpress::get_instance()->get_settings(); 102 $app_id = $settings['app_id']; 127 $app_id = sanitize_text_field($settings['app_id']); 128 129 if (empty($app_id)) { 130 wp_send_json_error('Invalid app ID'); 131 wp_die(); 132 } 133 103 134 $cookie_name = $app_id . "_uid"; 104 135 105 136 if ( isset( $_COOKIE[$cookie_name] ) ) { 106 @ setrawcookie( $cookie_name , $_COOKIE[$cookie_name],["expires" => time() + YEAR_IN_SECONDS, "path" => COOKIEPATH, "domain" => ("." . COOKIE_DOMAIN),"samesite" => "Lax"] ); 137 $secure = is_ssl(); 138 // User ID cookie can be httponly since it's mainly for server-side identification 139 @ setrawcookie( $cookie_name , $_COOKIE[$cookie_name], [ 140 "expires" => time() + YEAR_IN_SECONDS, 141 "path" => COOKIEPATH, 142 "domain" => ("." . COOKIE_DOMAIN), 143 "samesite" => "Lax", 144 "secure" => $secure, 145 ] ); 107 146 } 147 148 wp_send_json_success('Cookie set successfully'); 149 wp_die(); 150 } 151 152 /** 153 * Generate nonce for AJAX calls 154 * 155 * @since 1.9.2 156 */ 157 public static function get_nonce() { 158 return wp_create_nonce('cltracker_nonce'); 108 159 } 109 160 110 161 } 111 162 112 add_action( 'wp_ajax_cltracker_unset_cookie' , array( 'CLTracker_Cookie', 'unset_cookie' ) ); 113 add_action( 'wp_ajax_nopriv_cltracker_unset_cookie' , array( 'CLTracker_Cookie', 'unset_cookie' ) ); 114 add_action( 'wp_ajax_cltracker_set1pd_cookie' , array( 'CLTracker_Cookie', 'set_unique_user_id_cookie' ) ); 163 // Register AJAX actions for both authenticated and non-authenticated users 164 // This is necessary for tracking functionality to work for all website visitors 165 add_action( 'wp_ajax_cltracker_unset_cookie', array( 'CLTracker_Cookie', 'unset_cookie' ) ); 166 add_action( 'wp_ajax_nopriv_cltracker_unset_cookie', array( 'CLTracker_Cookie', 'unset_cookie' ) ); 167 add_action( 'wp_ajax_cltracker_set1pd_cookie', array( 'CLTracker_Cookie', 'set_unique_user_id_cookie' ) ); 115 168 add_action( 'wp_ajax_nopriv_cltracker_set1pd_cookie', array( 'CLTracker_Cookie', 'set_unique_user_id_cookie' ) ); -
customerlabs-actionrecorder/tags/1.9.2/integrations/ecommerce/woocommerce.php
r2728289 r3309746 27 27 add_action( 'woocommerce_add_to_cart' , array( $this, 'add_to_cart' ) , 10, 3 ); 28 28 add_action( 'woocommerce_remove_cart_item', array( $this, 'remove_from_cart' ), 10, 1); 29 29 30 } 30 31 … … 144 145 $image_url = wp_get_attachment_image_url( $image_id, 'full' ); 145 146 146 CLTracker_Cookie::set_cookie( 'added_to_cart' . '_' . $id, json_encode( 147 array( 148 'event' => __( 'Added to cart', 'cltracker' ), 149 'attributes' => array( 150 "customProperties" => array( 151 "currency" => get_woocommerce_currency(), 152 "content_type" => "product_group" 153 ), 154 "productProperties" => array( 155 array( 156 'product_id' => $id, 157 'product_quantity' => $quantity, 158 'product_name' => $product->get_name(), 159 'product_price' => $product->get_price(), 160 'product_image' => $image_url, 161 'product_sku' => $product->get_sku(), 162 'product_category' => implode( ', ', wp_list_pluck( wc_get_product_terms( $product->get_id(), 'product_cat' ), 'name' ) ), 163 ) 147 // Instead of setting cookie, output JavaScript 148 $data = array( 149 'event' => __( 'Added to cart', 'cltracker' ), 150 'attributes' => array( 151 "customProperties" => array( 152 "currency" => get_woocommerce_currency(), 153 "content_type" => "product_group" 154 ), 155 "productProperties" => array( 156 array( 157 'product_id' => $id, 158 'product_quantity' => $quantity, 159 'product_name' => $product->get_name(), 160 'product_price' => $product->get_price(), 161 'product_image' => $image_url, 162 'product_sku' => $product->get_sku(), 163 'product_category' => implode( ', ', wp_list_pluck( wc_get_product_terms( $product->get_id(), 'product_cat' ), 'name' ) ), 164 164 ) 165 ), 166 'cached_event' => 'added_to_cart_' . $id 167 ) 168 )); 165 ) 166 ), 167 'cached_event' => 'added_to_cart_' . $id 168 ); 169 170 // Add inline script to store data in localStorage 171 // wp_add_inline_script('jquery', ' 172 // localStorage.setItem("added_to_cart_' . $id . '", ' . json_encode(json_encode($data)) . '); 173 // '); 174 CLTracker_Cookie::set_cookie( 'added_to_cart' . '_' . $id, json_encode( $data ) ); 169 175 170 176 } … … 215 221 ) 216 222 ), 217 'cached_event' => 'removed_from_cart_' . $ id223 'cached_event' => 'removed_from_cart_' . $cart_item['product_id'] 218 224 ) 219 225 )); -
customerlabs-actionrecorder/tags/1.9.2/templates/track.php
r2862092 r3309746 2 2 window.clWordpressTrack = function(){ 3 3 var _clsettings = <?php echo json_encode( CLTracker_WordPress::esc_js_deep( $settings ) ); ?>; 4 var _clnonce = "<?php echo wp_create_nonce('cltracker_nonce'); ?>"; 4 5 var _clSendEvent = function(woo_event_name, woo_attributes){ 5 6 if(woo_event_name == "Purchased"){ … … 34 35 action : 'cltracker_unset_cookie', 35 36 key : '<?php echo esc_js( $cached_event ); ?>', 37 nonce : _clnonce 36 38 37 39 }, … … 73 75 formData.append("action", "cltracker_unset_cookie"); 74 76 formData.append("key", value["cached_event"]); 77 formData.append("nonce", _clnonce); 75 78 _clSendEvent(value["event"], value["attributes"]); 76 79 -
customerlabs-actionrecorder/trunk/ActionRecorder.php
r3141407 r3309746 3 3 Plugin Name: WooCommerce Conversion Tracking 4 4 Description: A simple implementation of e-commerce events tracking for Wordpress 5 Version: 1.9. 15 Version: 1.9.2 6 6 License: GPLv2 7 7 Author: CustomerLabs Digital Solutions Pvt. Ltd. … … 272 272 */ 273 273 public function plugin_action_links( $links, $file ) { 274 error_log(print_r($links, true));275 274 // Not for other plugins, silly. NOTE: This doesn't work properly when 276 275 // the plugin for testing is a symlink!! If you change this, test it. -
customerlabs-actionrecorder/trunk/Readme.md
r3141407 r3309746 3 3 Tags: WooCommerce Conversion Tracking, WooCommerce Conversion Tracking Google Ads, WooCommerce Conversion Tracking GA4, WooCommerce Meta Ads Conversions API, WooCommerce event tracking, WooCommerce track events 4 4 Requires at least: 5.0 5 Tested up to: 6. 6.16 Stable tag: 1.9. 15 Tested up to: 6.8.1 6 Stable tag: 1.9.2 7 7 Requires PHP: 7.0 8 8 License: GPLv2 … … 14 14 15 15 CustomerLabs plugin is one of the best WooCommerce plugins to track conversion events on your WooCommerce store, and send it to Ad platforms seamlessly. This plugin goes beyond conversion tracking and establishes a robust connection of your WooCommerce store with ad platforms. 16 17 🔒 **Enhanced Security**: Version 1.9.2 includes comprehensive security improvements with CSRF protection, enhanced access controls, and secure cookie handling to ensure your data is protected. 16 18 17 19 ### With the automatic event tracking for your WooCommerce store by [CustomerLabs](https://customerlabs.com/), you can track … … 42 44 * Connect WhatsApp 43 45 * Sync the data with BigQuery for detailed analysis of your data, creating custom reports and more 46 * **Enhanced security features** with CSRF protection and secure cookie handling 44 47 45 48 … … 56 59 * Helps activate anonymous website visitors 57 60 * ROI positive implementation 61 * **Secure and compliant** with WordPress security best practices 58 62 59 63 … … 77 81 That's it! You can now turn on any Destinations in CustomerLabs CDP Destinations section. 78 82 83 ## Security 84 85 Version 1.9.2 includes comprehensive security enhancements: 86 - **CSRF Protection**: All AJAX endpoints are protected with nonce verification 87 - **Enhanced Access Controls**: Improved input validation and sanitization 88 - **Secure Cookie Handling**: Proper security flags for cookie protection 89 - **WordPress Security Compliance**: Follows WordPress security best practices 90 - **Information Protection**: Removed debug code to prevent data leakage 91 79 92 ## Frequently Asked Questions 80 93 81 - Is CustomerLabs Plugin for WooCommerce Conversion Tracking Free? = 94 **Is CustomerLabs Plugin for WooCommerce Conversion Tracking Free?** 82 95 83 96 Yes. CustomerLabs plugin for WooCommerce Conversion Tracking is a free plugin on WordPress for your WooCommerce store. However, you would need CustomerLabs account to leverage the plugin 84 97 85 - Is CustomerLabs WooCommerce Conversion Tracking on the server-side? = 98 **Is CustomerLabs WooCommerce Conversion Tracking on the server-side?** 86 99 87 100 CustomerLabs offers a robust 1P domain tracking or the first-party domain that helps you set first-party cookies that stay for almost a lifetime. You can leverage it to reinforce your WooCommerce store conversion tracking efforts, and get a complete customer journey without any signal loss. 88 101 89 - Does CustomerLabs plugin offer WooCommerce Conversion Tracking for Google Ads? = 102 **Does CustomerLabs plugin offer WooCommerce Conversion Tracking for Google Ads?** 90 103 91 104 Yes. CustomerLabs free plugin offers direct and seamless integration with Google Ads, helping you with WooCommerce Conversion Tracking in Google Ads. 92 105 93 - Does CustomerLabs plugin offer WooCommerce Conversions API for Meta Ads? = 106 **Does CustomerLabs plugin offer WooCommerce Conversions API for Meta Ads?** 94 107 95 108 CustomerLabs plugin offers one click integration of data from your website to Meta Ads through Conversions API. The entire technology is robust that would help you mitigate signal loss to Meta Ads. 96 109 97 98 - Does CustomerLabs plugin offer WooCommerce Conversion Tracking for GA4? = 110 **Does CustomerLabs plugin offer WooCommerce Conversion Tracking for GA4?** 99 111 100 112 WooCommerce conversion tracking in GA4 is essential for marketers, and CustomerLabs offers GA4 integration for your store through Google Measurement Protocol (GMP) sending all the data on the server-side with just a few clicks. 101 113 102 - Why is CustomerLabs the best plugin for WooCommerce stores? = 114 **Is the plugin secure?** 115 116 Yes, version 1.9.2 includes comprehensive security enhancements including CSRF protection, secure cookie handling, enhanced access controls, and follows WordPress security best practices to protect your data. 117 118 **Why is CustomerLabs the best plugin for WooCommerce stores?** 103 119 104 120 CustomerLabs plugin offers one-stop solution for tracking all conversions including custom conversions for your WooCommerce stores and send the conversion tracking data across to any platform such as GA4, Google Ads, Meta Ads, LinkedIn Ads, and more, with just a few clicks! It offers consent mode v2 for Google Ads, and a centralized consent triggers for all marketing platforms from a single space. It goes beyond conversion tracking and offers synthetic event optimization. To know more, reach out to our experts and get a free 1PD OPs consultation [here](http://customerlabs.com/request-a-demo/) … … 111 127 ## Changelog 112 128 113 = 1.9.1 = 129 **1.9.2** 130 * Security Enhancement - Implemented comprehensive security improvements 131 * Security Enhancement - Added CSRF protection with nonce verification 132 * Security Enhancement - Enhanced access controls and input validation 133 * Security Enhancement - Improved cookie security with proper flags 134 * Security Enhancement - Removed debug code to prevent information disclosure 135 * Security Enhancement - Follows WordPress security best practices 136 * Bug Fix - Improved error handling and sanitization 137 138 **1.9.1** 114 139 * Bug Fix - fixed cookie set on cashed pages 115 140 116 = 1.9.0 = 141 **1.9.0** 117 142 * Server side cookie tracking - user_id implementation 118 143 119 = 1.8.2 = 144 **1.8.2** 120 145 * README.md updated 121 146 122 = 1.8.1 = 147 **1.8.1** 123 148 * Javascript variable conflict on cookie update 124 149 125 = 1.8.0 = 150 **1.8.0** 126 151 * Plugin name changed from Action Recorder -> Customerlabs CDP 127 152 128 = 1.7.0 = 153 **1.7.0** 129 154 * Plugin tested upto latest version of WordPress-6.1.1 130 155 131 = 1.6.0 = 156 **1.6.0** 132 157 * Handled duplicate purchase event triggers 133 158 134 = 1.5.0 = 159 **1.5.0** 135 160 * Cookies values contains plus instead of space issue fixed 136 161 137 = 1.4.0 = 162 **1.4.0** 138 163 * Handling ajax triggers from frontend for add_to_cart and remove_from_cart 139 164 140 = 1.3.1 = 165 **1.3.1** 141 166 * Removed user traits from "User Signed Up" and "User Logged In" events 142 167 143 = 1.3.0 = 168 **1.3.0** 144 169 * Fixed multiple ajax events 145 170 * Fixed multiple events tracking on page load 146 171 147 = 1.2.1 = 172 **1.2.1** 148 173 * Bug Fix settings update issue 149 174 150 = 1.2.0 = 175 **1.2.0** 151 176 * Added search event tracking 152 177 153 = 1.1.0 = 178 **1.1.0** 154 179 * woocommerce tracking 155 180 156 = 1.0.0 = 181 **1.0.0** 157 182 * Initial release! 158 183 159 184 ## Upgrade Notice 160 185 161 = 1.9.1 = 186 **1.9.2** 187 IMPORTANT SECURITY UPDATE: This version includes critical security enhancements including CSRF protection, enhanced access controls, and secure cookie handling. Update immediately for improved security and protection. 188 189 **1.9.1** 162 190 Bug Fix - fixed cookie set on cashed pages 163 191 164 = 1.9.0 = 192 **1.9.0** 165 193 Server side cookie tracking - user_id implementation 166 194 167 = 1.8.2 = 195 **1.8.2** 168 196 README.md updated 169 197 170 = 1.8.1 = 198 **1.8.1** 171 199 Javascript variable conflict on cookie update 172 200 173 = 1.8.0 = 201 **1.8.0** 174 202 Plugin name changed from Action Recorder -> Customerlabs CDP 175 203 176 = 1.7.0 = 204 **1.7.0** 177 205 Plugin tested upto latest version of WordPress-6.1.1 178 206 179 = 1.6.0 = 207 **1.6.0** 180 208 Handled duplicate purchase event triggers 181 209 182 = 1.5.0 = 210 **1.5.0** 183 211 Cookies values contains plus instead of space issue fixed 184 212 185 = 1.4.0 = 213 **1.4.0** 186 214 Handling ajax triggers from frontend for add_to_cart and remove_from_cart 187 215 188 = 1.3.1 = 216 **1.3.1** 189 217 Removed user traits from "User Signed Up" and "User Logged In" events 190 218 191 = 1.3.0 = 219 **1.3.0** 192 220 Fixed multiple ajax events 193 221 Fixed multiple events tracking on page load 194 222 195 = 1.2.1 = 223 **1.2.1** 196 224 Bug Fix settings update issue 197 225 198 = 1.2.0 = 226 **1.2.0** 199 227 Added search event tracking 200 201 = 1.1.0 =202 Supports woocommerce integration203 204 = 1.0 =205 Just released into the wild. -
customerlabs-actionrecorder/trunk/Readme.txt
r3141407 r3309746 3 3 Tags: WooCommerce Conversion Tracking, WooCommerce Conversion Tracking Google Ads, WooCommerce Conversion Tracking GA4, WooCommerce Meta Ads Conversions API, WooCommerce event tracking, WooCommerce track events 4 4 Requires at least: 5.0 5 Tested up to: 6. 6.16 Stable tag: 1.9. 15 Tested up to: 6.8.1 6 Stable tag: 1.9.2 7 7 Requires PHP: 7.0 8 8 License: GPLv2 … … 14 14 15 15 CustomerLabs plugin is one of the best WooCommerce plugins to track conversion events on your WooCommerce store, and send it to Ad platforms seamlessly. This plugin goes beyond conversion tracking and establishes a robust connection of your WooCommerce store with ad platforms. 16 17 🔒 **Enhanced Security**: Version 1.9.2 includes comprehensive security improvements with CSRF protection, enhanced access controls, and secure cookie handling to ensure your data is protected. 16 18 17 19 ### With the automatic event tracking for your WooCommerce store by [CustomerLabs](https://customerlabs.com/), you can track … … 42 44 * Connect WhatsApp 43 45 * Sync the data with BigQuery for detailed analysis of your data, creating custom reports and more 46 * **Enhanced security features** with CSRF protection and secure cookie handling 44 47 45 48 … … 56 59 * Helps activate anonymous website visitors 57 60 * ROI positive implementation 61 * **Secure and compliant** with WordPress security best practices 58 62 59 63 … … 85 89 WooCommerce conversion tracking in GA4 is essential for marketers, and CustomerLabs offers GA4 integration for your store through Google Measurement Protocol (GMP) sending all the data on the server-side with just a few clicks. 86 90 91 = Is the plugin secure? = 92 Yes, version 1.9.2 includes comprehensive security enhancements including CSRF protection, secure cookie handling, enhanced access controls, and follows WordPress security best practices to protect your data. 93 87 94 = Why is CustomerLabs the best plugin for WooCommerce stores? = 88 95 CustomerLabs plugin offers one-stop solution for tracking all conversions including custom conversions for your WooCommerce stores and send the conversion tracking data across to any platform such as GA4, Google Ads, Meta Ads, LinkedIn Ads, and more, with just a few clicks! It offers consent mode v2 for Google Ads, and a centralized consent triggers for all marketing platforms from a single space. It goes beyond conversion tracking and offers synthetic event optimization. To know more, reach out to our experts and get a free 1PD OPs consultation [here](http://customerlabs.com/request-a-demo/) … … 94 101 95 102 == Changelog == 103 104 = 1.9.2 = 105 * Security Enhancement - Implemented comprehensive security improvements 106 * Security Enhancement - Added CSRF protection with nonce verification 107 * Security Enhancement - Enhanced access controls and input validation 108 * Security Enhancement - Improved cookie security with proper flags 109 * Security Enhancement - Removed debug code to prevent information disclosure 110 * Security Enhancement - Follows WordPress security best practices 111 * Bug Fix - Improved error handling and sanitization 96 112 97 113 = 1.9.1 = … … 143 159 == Upgrade Notice == 144 160 161 = 1.9.2 = 162 IMPORTANT SECURITY UPDATE: This version includes critical security enhancements including CSRF protection, enhanced access controls, and secure cookie handling. Update immediately for improved security and protection. 163 145 164 = 1.9.1 = 146 165 Bug Fix - fixed cookie set on cashed pages -
customerlabs-actionrecorder/trunk/class.cltracker-cookie.php
r3141407 r3309746 15 15 * @param string $key Name of the cookie 16 16 * @param string $value Value of the cookie 17 * @param bool $httponly Whether cookie should be httponly (default false for tracking cookies) 17 18 * 18 19 * @since 1.0.0 19 20 * 20 21 */ 21 public static function set_cookie( $key, $value ) { 22 @ setrawcookie( 'cltracker_' . $key . '_' . COOKIEHASH, rawurlencode($value), time() + DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); 22 public static function set_cookie( $key, $value, $httponly = false ) { 23 // Set secure cookie with appropriate flags 24 $secure = is_ssl(); 25 // Most tracking cookies need JavaScript access, so httponly is optional 26 @ setrawcookie( 'cltracker_' . $key . '_' . COOKIEHASH, rawurlencode($value), time() + DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, $secure, $httponly ); 23 27 $_COOKIE[ 'cltracker_' . $key . '_' . COOKIEHASH ] = $value; 24 28 } … … 64 68 } 65 69 66 print_r($set);70 // Removed debug print_r that was leaking information 67 71 68 72 if (!$set) { … … 83 87 public static function unset_cookie( $key = '' ) { 84 88 89 // Verify nonce for CSRF protection 90 if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'cltracker_nonce')) { 91 wp_send_json_error('Security check failed'); 92 wp_die(); 93 } 94 85 95 if ( isset( $_POST['key'] ) ) { 86 96 $key = sanitize_text_field( $_POST['key'] ); 87 97 } 88 98 89 @ setcookie( 'cltracker_' . $key . '_' . COOKIEHASH, '', time() - DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); 99 // Enhanced key validation 100 if (empty($key) || !preg_match('/^[a-zA-Z0-9_]+$/', $key)) { 101 wp_send_json_error('Invalid key format'); 102 wp_die(); 103 } 104 105 // Set secure cookie deletion - no httponly needed for deletion 106 $secure = is_ssl(); 107 @ setcookie( 'cltracker_' . $key . '_' . COOKIEHASH, '', time() - DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN, $secure, false ); 90 108 unset( $_COOKIE[ 'cltracker_' . $key . '_' . COOKIEHASH ] ); 91 109 92 wp_send_json_success( $key ); 110 wp_send_json_success( 'Cookie cleared successfully' ); 111 wp_die(); 93 112 } 94 113 … … 99 118 */ 100 119 public static function set_unique_user_id_cookie() { 120 // Verify nonce for CSRF protection 121 if (!isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'cltracker_nonce')) { 122 wp_send_json_error('Security check failed'); 123 wp_die(); 124 } 125 101 126 $settings = CLTracker_Wordpress::get_instance()->get_settings(); 102 $app_id = $settings['app_id']; 127 $app_id = sanitize_text_field($settings['app_id']); 128 129 if (empty($app_id)) { 130 wp_send_json_error('Invalid app ID'); 131 wp_die(); 132 } 133 103 134 $cookie_name = $app_id . "_uid"; 104 135 105 136 if ( isset( $_COOKIE[$cookie_name] ) ) { 106 @ setrawcookie( $cookie_name , $_COOKIE[$cookie_name],["expires" => time() + YEAR_IN_SECONDS, "path" => COOKIEPATH, "domain" => ("." . COOKIE_DOMAIN),"samesite" => "Lax"] ); 137 $secure = is_ssl(); 138 // User ID cookie can be httponly since it's mainly for server-side identification 139 @ setrawcookie( $cookie_name , $_COOKIE[$cookie_name], [ 140 "expires" => time() + YEAR_IN_SECONDS, 141 "path" => COOKIEPATH, 142 "domain" => ("." . COOKIE_DOMAIN), 143 "samesite" => "Lax", 144 "secure" => $secure, 145 ] ); 107 146 } 147 148 wp_send_json_success('Cookie set successfully'); 149 wp_die(); 150 } 151 152 /** 153 * Generate nonce for AJAX calls 154 * 155 * @since 1.9.2 156 */ 157 public static function get_nonce() { 158 return wp_create_nonce('cltracker_nonce'); 108 159 } 109 160 110 161 } 111 162 112 add_action( 'wp_ajax_cltracker_unset_cookie' , array( 'CLTracker_Cookie', 'unset_cookie' ) ); 113 add_action( 'wp_ajax_nopriv_cltracker_unset_cookie' , array( 'CLTracker_Cookie', 'unset_cookie' ) ); 114 add_action( 'wp_ajax_cltracker_set1pd_cookie' , array( 'CLTracker_Cookie', 'set_unique_user_id_cookie' ) ); 163 // Register AJAX actions for both authenticated and non-authenticated users 164 // This is necessary for tracking functionality to work for all website visitors 165 add_action( 'wp_ajax_cltracker_unset_cookie', array( 'CLTracker_Cookie', 'unset_cookie' ) ); 166 add_action( 'wp_ajax_nopriv_cltracker_unset_cookie', array( 'CLTracker_Cookie', 'unset_cookie' ) ); 167 add_action( 'wp_ajax_cltracker_set1pd_cookie', array( 'CLTracker_Cookie', 'set_unique_user_id_cookie' ) ); 115 168 add_action( 'wp_ajax_nopriv_cltracker_set1pd_cookie', array( 'CLTracker_Cookie', 'set_unique_user_id_cookie' ) ); -
customerlabs-actionrecorder/trunk/integrations/ecommerce/woocommerce.php
r2728289 r3309746 27 27 add_action( 'woocommerce_add_to_cart' , array( $this, 'add_to_cart' ) , 10, 3 ); 28 28 add_action( 'woocommerce_remove_cart_item', array( $this, 'remove_from_cart' ), 10, 1); 29 29 30 } 30 31 … … 144 145 $image_url = wp_get_attachment_image_url( $image_id, 'full' ); 145 146 146 CLTracker_Cookie::set_cookie( 'added_to_cart' . '_' . $id, json_encode( 147 array( 148 'event' => __( 'Added to cart', 'cltracker' ), 149 'attributes' => array( 150 "customProperties" => array( 151 "currency" => get_woocommerce_currency(), 152 "content_type" => "product_group" 153 ), 154 "productProperties" => array( 155 array( 156 'product_id' => $id, 157 'product_quantity' => $quantity, 158 'product_name' => $product->get_name(), 159 'product_price' => $product->get_price(), 160 'product_image' => $image_url, 161 'product_sku' => $product->get_sku(), 162 'product_category' => implode( ', ', wp_list_pluck( wc_get_product_terms( $product->get_id(), 'product_cat' ), 'name' ) ), 163 ) 147 // Instead of setting cookie, output JavaScript 148 $data = array( 149 'event' => __( 'Added to cart', 'cltracker' ), 150 'attributes' => array( 151 "customProperties" => array( 152 "currency" => get_woocommerce_currency(), 153 "content_type" => "product_group" 154 ), 155 "productProperties" => array( 156 array( 157 'product_id' => $id, 158 'product_quantity' => $quantity, 159 'product_name' => $product->get_name(), 160 'product_price' => $product->get_price(), 161 'product_image' => $image_url, 162 'product_sku' => $product->get_sku(), 163 'product_category' => implode( ', ', wp_list_pluck( wc_get_product_terms( $product->get_id(), 'product_cat' ), 'name' ) ), 164 164 ) 165 ), 166 'cached_event' => 'added_to_cart_' . $id 167 ) 168 )); 165 ) 166 ), 167 'cached_event' => 'added_to_cart_' . $id 168 ); 169 170 // Add inline script to store data in localStorage 171 // wp_add_inline_script('jquery', ' 172 // localStorage.setItem("added_to_cart_' . $id . '", ' . json_encode(json_encode($data)) . '); 173 // '); 174 CLTracker_Cookie::set_cookie( 'added_to_cart' . '_' . $id, json_encode( $data ) ); 169 175 170 176 } … … 215 221 ) 216 222 ), 217 'cached_event' => 'removed_from_cart_' . $ id223 'cached_event' => 'removed_from_cart_' . $cart_item['product_id'] 218 224 ) 219 225 )); -
customerlabs-actionrecorder/trunk/templates/track.php
r2862092 r3309746 2 2 window.clWordpressTrack = function(){ 3 3 var _clsettings = <?php echo json_encode( CLTracker_WordPress::esc_js_deep( $settings ) ); ?>; 4 var _clnonce = "<?php echo wp_create_nonce('cltracker_nonce'); ?>"; 4 5 var _clSendEvent = function(woo_event_name, woo_attributes){ 5 6 if(woo_event_name == "Purchased"){ … … 34 35 action : 'cltracker_unset_cookie', 35 36 key : '<?php echo esc_js( $cached_event ); ?>', 37 nonce : _clnonce 36 38 37 39 }, … … 73 75 formData.append("action", "cltracker_unset_cookie"); 74 76 formData.append("key", value["cached_event"]); 77 formData.append("nonce", _clnonce); 75 78 _clSendEvent(value["event"], value["attributes"]); 76 79
Note: See TracChangeset
for help on using the changeset viewer.