Pass GTM Email Address to Typeform | Community
Skip to main content
Answered

Pass GTM Email Address to Typeform

  • February 9, 2023
  • 3 replies
  • 109 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.

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>

 

View original

3 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14904 replies
  • February 9, 2023

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


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

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>

 


  • Navigating the Land
  • 2 replies
  • November 9, 2023

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