* 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', {
action,
score,
comments: comments || '',
store_age: storeAge,
...trackProps,
} );
@ -153,7 +154,6 @@ CustomerEffortScoreTracks.propTypes = {
* Whether tracking is allowed or not.
*/
allowTracking: PropTypes.bool,
/**
* Whether props are still being resolved.
*/

View File

@ -364,14 +364,15 @@ class CustomerEffortScoreTracks {
$this->enqueue_to_ces_tracks(
array(
'action' => self::SETTINGS_CHANGE_ACTION_NAME,
'label' => __(
'action' => self::SETTINGS_CHANGE_ACTION_NAME,
'label' => __(
'How easy was it to update your settings?',
'woocommerce-admin'
),
'pagenow' => 'woocommerce_page_wc-settings',
'adminpage' => 'woocommerce_page_wc-settings',
'props' => array(),
'onsubmit_label' => $this->onsubmit_label,
'pagenow' => 'woocommerce_page_wc-settings',
'adminpage' => 'woocommerce_page_wc-settings',
'props' => (object) array(),
)
);
}