We have a product page with 2 typeform buttons that open sliders :
Get full details slider typeform
&
Order now slider typeform
When people click on “get full details” they access a slider typeform and get an email with a call to action : order now email button
This order now email button leads to the product page.
I’d like that a specific url links to the product page but opens automatically the order now slider on that specific case
anyone has ideas how to achieve this with Typeform ?
with custom code ?
Many thanks in advance for your ideas and suggestions !
Regards
Antoine
Best answer by mathio-tf
Hello @Ant777
if you want to open your embedded typeform automatically, you can achieve this via Advanced Embed Options (Custom Launch Options → On Page Load). Alternatively the embed SDK has Custom Launch Options feature as well.
However if you want to open this only for specific URLs, you will need to implement this yourself via custom JavaScript code. Something like this:
<!-- button to open the slider manually --><buttonid="slider-link">open slider</button><!-- include embed lib JS and CSS --><scriptsrc="//embed.typeform.com/next/embed.js"></script><linkrel="stylesheet"href="//embed.typeform.com/next/css/slider.css" /><!-- custom logic below --><script>// create typeform slider embedconst mySlider = window.tf.createSlider('oWPUHPmF')
// attach 'open' function to button click to open the slider manually
document.querySelector('#slider-link').onclick = mySlider.open
// check URL query parameters if the slider should open automatically on page loadconst autoOpenSlider = window.location.search.includes('auto-open-slider-true')
if (autoOpenSlider) {
mySlider.open() // open automatically
}
</script>
if you want to open your embedded typeform automatically, you can achieve this via Advanced Embed Options (Custom Launch Options → On Page Load). Alternatively the embed SDK has Custom Launch Options feature as well.
However if you want to open this only for specific URLs, you will need to implement this yourself via custom JavaScript code. Something like this:
<!-- button to open the slider manually --><buttonid="slider-link">open slider</button><!-- include embed lib JS and CSS --><scriptsrc="//embed.typeform.com/next/embed.js"></script><linkrel="stylesheet"href="//embed.typeform.com/next/css/slider.css" /><!-- custom logic below --><script>// create typeform slider embedconst mySlider = window.tf.createSlider('oWPUHPmF')
// attach 'open' function to button click to open the slider manually
document.querySelector('#slider-link').onclick = mySlider.open
// check URL query parameters if the slider should open automatically on page loadconst autoOpenSlider = window.location.search.includes('auto-open-slider-true')
if (autoOpenSlider) {
mySlider.open() // open automatically
}
</script>