Skip to main content
Solved

Pre-populating user email address field in non-Klaviyo Forms

  • February 24, 2021
  • 2 replies
  • 801 views

sarah.lauden
Contributor I
Forum|alt.badge.img+2

I don’t love the way Klaviyo adds everything from a form to the profile (as custom properties). If I want to do a survey — it seems like I shouldn’t use Klaviyo. Do folks have experience pre-populating a user’s email address (from Klaviyo) into the email field in something like an embedded Google Form, or SquareSpace Form, or another tool?

Best answer by caroline

Hi there,

Other Community members may be able to make recommendations based on prebuilt tools they’ve used, but I thought I would chime in with another way to achieve this in Klaviyo.

If you wanted to create your own form via HTML, you could redirect the inputs you want to store in Klaviyo via custom code. Our Help Center article, How to Redirect Existing Signup Forms to Klaviyo, describes this process and provides code snippets.

Update 3/8/2021 -- Wanted to add some additional info on pre-filling fields in a form.

If you wanted to pre-fill the email address form with the email address that Klaviyo already has collected (if a user has been cookied), you could do so by using “_learnq.identify()”

If you open your browser’s console and enter “_learnq.identify()”, you’ll be able to see the email address Klaviyo has collected if you’ve been cookied. To pre-fill a form, you could use “_learnq.identify().$email”, for example. You would want to make sure to have an “if” statement for the case in which the user has not been identified and there is no email address available.

Hope this helps clarify!

Best,

Caroline

View original
Did this topic or the replies in the thread help you find an answer to your question?

2 replies

caroline
Forum|alt.badge.img+8
  • Klaviyo Alum
  • 215 replies
  • Answer
  • February 25, 2021

Hi there,

Other Community members may be able to make recommendations based on prebuilt tools they’ve used, but I thought I would chime in with another way to achieve this in Klaviyo.

If you wanted to create your own form via HTML, you could redirect the inputs you want to store in Klaviyo via custom code. Our Help Center article, How to Redirect Existing Signup Forms to Klaviyo, describes this process and provides code snippets.

Update 3/8/2021 -- Wanted to add some additional info on pre-filling fields in a form.

If you wanted to pre-fill the email address form with the email address that Klaviyo already has collected (if a user has been cookied), you could do so by using “_learnq.identify()”

If you open your browser’s console and enter “_learnq.identify()”, you’ll be able to see the email address Klaviyo has collected if you’ve been cookied. To pre-fill a form, you could use “_learnq.identify().$email”, for example. You would want to make sure to have an “if” statement for the case in which the user has not been identified and there is no email address available.

Hope this helps clarify!

Best,

Caroline


Forum|alt.badge.img+3
  • Problem Solver I
  • 10 replies
  • June 28, 2022
caroline wrote:

If you wanted to pre-fill the email address form with the email address that Klaviyo already has collected (if a user has been cookied), you could do so by using “_learnq.identify()”

If you open your browser’s console and enter “_learnq.identify()”, you’ll be able to see the email address Klaviyo has collected if you’ve been cookied. To pre-fill a form, you could use “_learnq.identify().$email”, for example. You would want to make sure to have an “if” statement for the case in which the user has not been identified and there is no email address available.

 

 

I think this no longer works, but I’d love it if you knew a workaround to grab the email address of the current cookied user.

See this thread for more info on that technique not being available…