* fix settings change enqueue params

* Include comments in score record callback

* send empty string for comments

Co-authored-by: Rebecca Scott <me@becdetat.com>
This commit is contained in:
Bec Scott 2020-11-26 10:25:09 +10:00 committed by GitHub
parent b4e309f964
commit cc5e500085
2 changed files with 8 additions and 7 deletions

View File

@ -98,10 +98,11 @@ function CustomerEffortScoreTracks( {
} ); } );
}; };
const recordScore = ( score ) => { const recordScore = ( score, comments ) => {
recordEvent( 'ces_feedback', { recordEvent( 'ces_feedback', {
action, action,
score, score,
comments: comments || '',
store_age: storeAge, store_age: storeAge,
...trackProps, ...trackProps,
} ); } );
@ -153,7 +154,6 @@ CustomerEffortScoreTracks.propTypes = {
* Whether tracking is allowed or not. * Whether tracking is allowed or not.
*/ */
allowTracking: PropTypes.bool, allowTracking: PropTypes.bool,
/** /**
* Whether props are still being resolved. * Whether props are still being resolved.
*/ */

View File

@ -369,9 +369,10 @@ class CustomerEffortScoreTracks {
'How easy was it to update your settings?', 'How easy was it to update your settings?',
'woocommerce-admin' 'woocommerce-admin'
), ),
'onsubmit_label' => $this->onsubmit_label,
'pagenow' => 'woocommerce_page_wc-settings', 'pagenow' => 'woocommerce_page_wc-settings',
'adminpage' => 'woocommerce_page_wc-settings', 'adminpage' => 'woocommerce_page_wc-settings',
'props' => array(), 'props' => (object) array(),
) )
); );
} }