Answered

Pass GTM Email Address to Typeform

  • 9 February 2023
  • 3 replies
  • 63 views

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.

icon

Best answer by mathio 10 February 2023, 11:33

View original

3 replies

Userlevel 7
Badge +5

@mathio do you happen to know how to do this? I’m not familiar with passing information from GTM into Typeform. 

Userlevel 7
Badge +5

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>

 

Hi @mathio I am trying to accomplish the same thing. I have my customer logged in and I want to record his email with typeform answer. I cannot seem to get the embed on my shopify page to read the customer email (at least that). Is there a way to fix it?
Thank you :)

Reply