capture marketo field to send to 3rd party from client browser | Community
Skip to main content
New Participant
March 1, 2024
Solved

capture marketo field to send to 3rd party from client browser

  • March 1, 2024
  • 3 replies
  • 3271 views

We're capturing customer emails from a marketo form on one of our site page.

That email is sent to Marketo/DB.

 

We'd like to ALSO send that email separately to another server from that page directly.

 

Is there a simple way to access that email so that I can reuse it in a different (non-marketo) script on that page.

 

The full context of the problem is as follows: the page contains affiliate converting tracking codes from `Impact.com` and for those pages (that contain the code) we need to pass Impact.com back that email. (so not for all visitors to that page, just those whose page came from our affiliate partners).

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Darshil_Shah1

Yes, you can use Marketo form2.0 JS to access the Email Address (and the other form fields the person submits on the form). Check out the code in “Read Form Field Values on Form Submit” example on the forms2.0 JS usage example page.

3 replies

SanfordWhiteman
New Participant
March 1, 2024

This would be better done in onSuccess, not onSubmit, because onSuccess means the data was completely sent to Marketo.

 

MktoForms2.whenReady(function(readyForm){ readyForm.onSuccess(function(submittedValues,thankYouURL){ // do something with the submittedValues object return false; }); });

 

frudmanAuthor
New Participant
March 1, 2024

don't disagree through for our purposes the data sent is based on where the user came from, regardless of whether or not the data makes it to marketo after submit (it does matter but not so significant in terms of executing the impact script).

Jo_Pitts1
Community Manager
March 1, 2024

@frudman ,

Does the third party have an API you can hit without exposing secure keys on the client side?  If not, you should definitely not be adopting a client side approach.  You really should be using a Marketo webhook.

Regards

Jo

 

 

frudmanAuthor
New Participant
March 1, 2024

I'm not sure but it's much easier (for our purposes) to simply grab-it-and-go from that page. The following page remains a standard template page (nothing specific based on user) and I'm not familiar with prior page (coming from a different company) to worry about changes there. Simplest is best is the solution provided is simple (enough!) for me to implement. 

SanfordWhiteman
New Participant
March 1, 2024

That’s incorrect. Using onSubmit isn’t “simpler”, because it has an inherent race condition which will cause your external calls to fail randomly (i.e. when the Thank You URL is loaded, it aborts all outstanding remote connections).

 

You should be using onSuccess if you want to have an actual working solution.

Darshil_Shah1
Darshil_Shah1Accepted solution
Community Manager
March 1, 2024

Yes, you can use Marketo form2.0 JS to access the Email Address (and the other form fields the person submits on the form). Check out the code in “Read Form Field Values on Form Submit” example on the forms2.0 JS usage example page.