How to handle that embed form is loaded?


What’s the best way to handle situations where a Typeform is loaded into an iframe using the Embed API but encounters issues? For example, if Typeform is unresponsive, or returns an error page instead of the form. Another scenario is when a teammate accidentally removes the form from the admin panel, causing the user to see the Typeform home page in the iframe instead of the form. I want to redirect users to another page in my app in such cases. How can I achieve that?

5 replies

Userlevel 7
Badge +5

Hi @User67 Most likely, the issue is caused because of the embed itself. If you’re able to use our embed codes here or the Embed SDK, that should help. 

Do you also mind sharing the URL where you have the form embedded so we can take a look? Thanks in advance!

Hi Liz,

I’m using the Embed SDK and have had no issues so far. However, I want to ensure that Typeform will work 100% of the time or have fallback behavior in place. I'm developing a user qualification functionality in my app, where after signup, users need to fill out a qualification form before they can proceed to the application.

Since Typeform, like any other web service, may be unavailable for various reasons (network issues, high load, vulnerabilities, etc.), such situations could break the functionality of my app. I want to implement a mechanism that can detect whether Typeform was successfully loaded. If it wasn't, I want to redirect my users to another fallback page.

How can I achieve this?

Userlevel 7
Badge +5

Hi @User67 Ah, got it. As you mentioned, it’s possible that our website might go down or the embed might not function. While we don't have a way to direct your respondents to a different page, I can instead suggest creating a code on your website that would, if the form isn’t loading for whatever reason, bring them to a different location. 

@mathio or @picsoung might have some suggestions/examples of this for you. 

Thanks for the answer, @Liz. I will handle the redirect or any other fallback functionality on my own. I just need a mechanism to let me know that Typeform has successfully loaded into the iframe and that the iframe contains the necessary content (the Typeform itself, not an error message or some other content).

I think it would be helpful to have a callback like onLoadError in the Embed API that would be executed in case of an unexpected load issue. I couldn't find anything similar in the documentation, but maybe there are some workarounds for this?

Userlevel 7
Badge +5

Hello @User67 

we have a similar feature in the backlog, but we do not have any dates we can promise just yet.

Feel free to make some noise about this on Github where we track features like this proposed by the community:

Thanks :)