Hello, I’m wondering how to pass my customer’s email address into my Typeform. The Typeform is embedded on the thank you page of my Shopify store and I want Typeform to associate the answers to the email of the customer who just placed the order. The email is captured by my Google Tag Manager already. I just don’t know how to pass that information to Typeform.
Answered
Pass GTM Email Address to Typeform
Best answer by mathio-tf
I am not familiar with GTM. However you can pass values yo your typeform via hidden fields.
If you can retrieve the value from your GTM in JavaScript you can use a code like this:
<div id="form" style="width:100%;height:500px;"></div>
<link rel="stylesheet" href="//embed.typeform.com/next/css/widget.css />
<script src="//embed.typeform.com/next/embed.js />
<script>
const email = getEmailFromGtm() // I am not familiar with this step, please refer to GTM docs
window.tf.createWidget('<id>', {
container: document.querySelector('#form'),
hidden: { email }
})
</script>
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.