Form submission not recorded sometime

I have hubspot form that is embedded in wordpress page.
I add code in javascript to send the redirect to different pages basis on the fields of form.

The code is fired on this event
window.addEventListener(‘message’, event => {
if (event.data.type === ‘hsFormCallback’ && event.data.eventName === ‘onFormSubmit’) {
But some time my form submission is not recorded in the hubspot.
Could you please help me?

Hi, @monikayr :waving_hand: Welcome to the community. It’s challenging for our community members to help troubleshoot issues like this without having a link or a way to see this issue happening in real time.

A few general troubleshooting thoughts:

  • Open the page inspector and use the network tab. Submit the form. Check if this request completes successfully before the page redirects
  • You can try adding console.log before and after the form submission to listen for the trigger and when the redirection starts
  • You could run a test using setTimeout before the redirect. If the submission consistently works after adding the delay, you can dig into timing issues

Best,

Jaycee