submitPopupEmail

Collecting contacts

Call this method whenever a visitor input his/her e-mail address into the pop-up signup or website opt-in form. Yottly will give you information whether this email address is already known or unknown. Only valid and unknown email addresses can receive welcome pop-up emails (if activated) and will be stored to the customer database.

diffAnalytics.submitPopupEmail(email, function(err, response))

  • email – string (valid email address)
  • If there is no error, the response includes one of these:
    • response = { emailValid: false }  //the email address is invalid
    • response = { emailValid: true, emailKnown: true } //the email address is valid, but it is already in the customer feed or it has been collected by this function before
    • response = { emailValid: true, emailKnown: false } //the email address is valid and not present in current customer database
      • Only in this case the contact is stored in database and welcome pop-up email is sent (if activated)
  • Call this method whenever the visitor input his/her email address into pop-up signup form or opt-in form at your website

Full example:

Insert this into your browser console:

diffAnalytics.submitPopupEmail('email@customer.com',function (err,value){console.log(value)})

submitpopupemail_example

Was this article helpful to you? Yes No