window.addEventListener('consoltoEvent', (e) => {
if (e.detail.consoltoReady) { //waiting until consolto widget is ready
// Send client info
var userDataEvent = new CustomEvent('consolto_h2w', {
detail: {
'et-client-info': true,
'et-phone': '783240477851', // modify the phone number to the number that your platform captured.
'et-first-name': 'John', // modify the first name to the name that your platform captured.
'et-last-name': 'Dow', // modify the last name to the name that your platform captured.
'et-email': 'johndow@gmail.com', // modify the email to the email that your platform captured.
},
});
window.dispatchEvent(userDataEvent);
}
});