There are no errors in the console nor failed requests in the network tab.
I have tried with several forms and get the same results each time. The forms are published and the preview page loads just fine from within HubSpot itself.
I have tried this on its own in a plain HTML file and get the same results, so it’s not some other scripts on the website interfering.
I wondered if there could be options somewhere which limit the domains this can run on, but wasn’t able to find such options - and would expect an error to be thrown if that were the case anyway.
The page is at https://cpg-softlaunch.quba.co.uk/en-gb/talk-to-us/. I have realised that the form works just fine on Chrome, but not on Firefox (even with Enhanced Tracking Protection off). If I hit F5 a bunch of times it will occasionally load, maybe 1 out of 5 times.
If I use the raw HTML option instead of iframe this seems to work fine - and as I’m wanting to style it up with custom CSS this is the right option for me anyway.
Not sure if this is the issue, but Firefox has some unique security/privacy features that might block the iframe content. But if you can use the Raw HTML vs iframe that would be ideal because it gives you more control of what happens on the page.
Yes I wondered about that and did try switching off Enhanced Tracking Protection but this didn’t seem to have any effect. Perhaps there are other security features blocking it - although it’s odd that it would still work occasionally.
Try editing your embed code to include a target div with a unique ID. This will tell the script to load the form in the div. I have had issues loading forms in wordpress sites and the target ID fixed the loading issue. If this doesn’t work, another thing you could try is wrapping the form embed code with a on window load. This will run the code after everything else on your page is done loading.
window.addEventListener('load', (event) => {
// paste your form embed code in here
});
Thanks for the suggestions @Jake_Lett, but unfortunately neither solved the issue. If it helps, this is only a problem on Firefox - see my other reply.