Javascript Event Listener
<script src="https://d3pw37i36t41cq.cloudfront.net/embed_v2.js" async></script>
<script>
window._wf = window._wf || [];
_wf.push({ id: '3xz1oVMRvKB96hhhjjhh', onReady: function(api) {
api.onSubmit(function(data) {
console.log('onSubmit', data);
});
api.onLeadSubmit(function(data) {
console.log('onLeadSubmit', data);
});
}});
</script>
In response (data variable in this example) we have the following fields:
first_name
last_name
phone
custom_fields - this is object with nested custom fields: for example it will contain: Agreement: true, quiz1: "option4", secondary_phone: "123123123"