Manage Hide/Display of Typeform Button | Community
Skip to main content
Answered

Manage Hide/Display of Typeform Button


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.

Best answer by mathio-tf

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.

View original

5 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14960 replies
  • April 5, 2023

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. 


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • Answer
  • April 5, 2023

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.


  • Author
  • Explorer
  • 4 replies
  • April 6, 2023

@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?

  • Author
  • Explorer
  • 4 replies
  • April 12, 2023

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


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • April 12, 2023

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