← All changes
|
jetpack_vendor/automattic/woocommerce-analytics/src/class-universal.php
+3
-2
16.2
→
16.3
View file →
| @@ -81,9 +81,10 @@ | ||
| 81 | 81 | $common_properties = $is_proxy_tracking_enabled ? array() : $this->get_page_common_properties(); |
| 82 | 82 | ?> |
| 83 | 83 | <script type="text/javascript"> |
| 84 | 84 | (function() { |
| 85 | - window.wcAnalytics = window.wcAnalytics || {}; | |
| 85 | + // Always start from a fresh object: a `||` fallback would keep a same-named DOM element alive. | |
| 86 | + window.wcAnalytics = {}; | |
| 86 | 87 | const wcAnalytics = window.wcAnalytics; |
| 87 | 88 | |
| 88 | 89 | // Set the assets URL for webpack to find the split assets. |
| 89 | 90 | wcAnalytics.assets_url = '<?php echo esc_url( plugins_url( '../build/', __DIR__ . '/class-woocommerce-analytics.php' ) ); ?>'; |
| @@ -546,9 +547,9 @@ | ||
| 546 | 547 | public function capture_search_query() { |
| 547 | 548 | if ( is_search() ) { |
| 548 | 549 | global $wp_query; |
| 549 | 550 | $this->enqueue_event( |
| 550 | - 'search', | |
| 551 | + 'search_performed', | |
| 551 | 552 | array( |
| 552 | 553 | 'search_query' => $this->cap_page_string( $wp_query->get( 's' ) ), |
| 553 | 554 | 'qty' => $wp_query->found_posts, |
| 554 | 555 | ) |