Answered

Hidden Fields not working on some URLs

  • 2 December 2021
  • 9 replies
  • 535 views

Our system sends out a ‘Client Follow up’ email after every order to obtain customer feedback. We include our order_id, first_name, email, resto_name in the URL for Typeform to fill the hidden fields. Prior to September it was working 100% of the time, since then we are only seeing around 20% of our forms having the hidden fields populated. Our “typeform-widget” url hasn’t changed, is there anything that can be done to understand why this is only working intermittently? 
 

 

icon

Best answer by mathio 9 December 2021, 17:30

View original

9 replies

Userlevel 7
Badge +5

Hi @Mike Pearson Happy Friday! How are you passing the data into the form? Could you share that code (or the website URL) so we can take a look? Thanks!

<div class="typeform-widget" data-url="https://form.typeform.com/to/AOR4mO?typeform-medium=embed-snippet#order_id=398595&amp;first_name=Mike&amp;email=pearson3105@gmail.com&amp;resto_name=Bar%20Rail" style="width: 100%; height: 500px;"><div class="css-1o3fej e12baen60"><div class="css-1ig7ubs e12baen62"><iframe frameborder="0" height="100%" src="https://form.typeform.com/to/AOR4mO?typeform-medium=embed-snippet&amp;typeform-embed=embed-widget&amp;typeform-embed-id=prhgz" width="100%" allow="camera; microphone; autoplay; encrypted-media;" data-qa="iframe" title="typeform-embed" style="border: 0px;"></iframe></div></div></div>

Thanks @Liz - Please see the code above

Userlevel 7
Badge +5

Ah, I think I see the issue. When you’re embedding the form and changing the values, you’ll need to add a little extra code, which you can read more about here. This should then pass in the data! Let me know if that doesn’t work for you.  

Ok, thanks @Liz. Appreciate the speedy response! I’ll share this with our team to update. Is there a reason why it would work sometimes and not others? And has anything changed? This was working ok for a long time

Userlevel 7
Badge +5

Hi @Mike Pearson I can’t really think of a reason why it would only partially work, but if it doesn’t work with the new code at all, please let me know!

@Liz Our dev team has come back and said that this is the code that is currently being sent. Seems the suggestion in the article was already implemented. Is there anything else that you can think of? 

 

<div class="typeform-widget" data-url="" style="width: 100%; height: 500px;"></div><script>// Sets the url of the widget with query params(function() { var tw = document.querySelector('.typeform-widget');tw.setAttribute('data-url', 'https://form.typeform.com/to/AOR4mO?typeform-medium=embed-snippet#' + document.location.search.slice(1));})();</script><script> (function() { var qs,js,q,s,d=document, gi=d.getElementById, ce=d.createElement, gt=d.getElementsByTagName, id="typef_orm", b="https://embed.typeform.com/"; if(!gi.call(d,id)) { js=ce.call(d,"script"); js.id=id; js.src=b+"embed.js"; q=gt.call(d,"script")[0]; q.parentNode.insertBefore(js,q) } })() </script>
Userlevel 7
Badge +5

Hi @Mike Pearson I’m afraid we aren’t able to troubleshoot forms using custom code. If you can add the direct code we provide, we can be happy to take a look at this!

@mathio might have some suggestions for the code you’ve added to our embed code. 

Userlevel 7
Badge +5

Hello @Mike Pearson 

I can see you have not implemented the suggestion from the article @Liz linked above. You need to go to your typeforms share page, copy embed code from there and then add data-tf-hidden with your hidden fields names and values.

If you need a more integrated solution you can point your dev team to our embed lib on Github. All they need is form ID (you can find it in your typeform URL form.typeform.com/to/<ID>) and they can embed it in your website.

Reply