Answered

Manage Hide/Display of Typeform Button

  • 5 April 2023
  • 5 replies
  • 217 views

We want to implement a feature where Customer would have an option to Dismiss the Survey Form by clicking on the "Dismiss" Button. And if he/she does "Dismiss" the Survey Form, then we want that Neither the Survey Form Nor the Survey Trigger Link be displayed to the Customer for XX amount of Days (Example 30 days).Does Typeform supports this kind of feature? Or do we need to add custom solution within our Storefront to hide/display the button based on cookie.
icon

Best answer by mathio 5 April 2023, 19:21

View original

5 replies

Userlevel 7
Badge +5

Hi @ToskaValeska This is a great idea. You would need to add custom code for this feature, but @mathio might have some examples of how to do this. 

Userlevel 7
Badge +5

Hello @ToskaValeska.

You can implement this with custom JavaScript and cookies.

If you are embedding as widget you can use custom button and set a cookie when the button is clicked. If you are embedding as popup (slider, popover or side tab) you can also set the cookie when the form is closed (in onClose callback).

I think code for a solution like this is available somewhere in the community already. However I can not find it, so I have decided to publish it here:

Hope this helps.

@mathio thanks for your prompt feedback!
We have a follow up question:

The Content of the Survey Form is from Typeform and is displayed via Iframe. So in the Iframe, do we have "Dismiss" Button explicitly or should we consider the "x" (i.e. Close Survey Form Pop-up) as the Dismiss? And when customer does Dismiss the Form, is there any callback function or parameter of Iframe which we can catch within SFCC Storefront with which we can identify that customer have either clicked on "Dismiss" Button or the "x" button?

@mathio, @Liz do you already have news on that? 

Userlevel 7
Badge +5

Typeform does not provide the dismiss button nor the functionality out of the box.

As you can see in the code I provided you can either build your own button (outside of the iframe) or you could use the “x” button via onClose callback of your embed. In both cases you need to handle the functionality yourself (see setDismissCookie function) and you can execute any JavaScript code you want in there.

Reply