window.sparrowConfig = {
triggerOnLoad: false
}
window.SparrowLauncher('popup', {
variables: {
name: "John Doe",
useremail: "john@acmeinc.com"
}
})
window.addEventListener('message', (e) => {
if(e && e.data && e.data.type === 'surveyCompleted') {
const { response, customParams } = e.data;
window.SparrowLauncher('remove')
}
});
For more visit: https://help.surveysparrow.com/surveysparrow-widgets-how-to-make-the-maximum-use-of-it