Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
CustomerEffortScoreTracks::get_script_track_edit_php( string $action, string $label )
Returns a generated script for tracking tags added on edit-tags.php page.
Description Description
CES survey is triggered via direct access to wc/customer-effort-score store via wp.data.dispatch method.
Due to lack of options to directly hook ourselves into the ajax post request initiated by edit-tags.php page, we infer a successful request by observing an increase of the number of rows in tags table
Parameters Parameters
- $action
-
(Required) Action name for the survey.
- $label
-
(Required) Label for the snackbar.
Return Return
(string) Generated JavaScript to append to page.
Source Source
File: packages/woocommerce-admin/src/Features/CustomerEffortScoreTracks.php