Will this function help (let’s take form id be “myForm”)
var formLoadedInterval = setInterval(function()
I have come to this discussion because i am myself experiencing this issue a lot. Implementing your idea has reduced the number of failures but still out of 10 form submissions i am getting only 7-8 submissions in my database only. I have no control how the form is being loaded because i am 3rd party.
I have checked logs of requests on my server. In case of failures i can see change_form request but submit_form request is not present though form has been successfully submitted to the server of website where we have deployed our tracking code.If change_form requests are present then window.snowplow(‘enableFormTracking’) function is working fine i guess. Can you help me find the root cause?