Having trouble finding documentation of the process of setting up an API that feeds into a list that is part of a campaign.
Goal is to import new registrants via API (or FTP if possible) who then receive a welcome email right away. The form collecting this data is not a Marketo form.
you are better off to use a hidden Marketo form, take the data from the third party form and submit into Marketo that way.
Something along these lines:
MktoForms2.loadForm("//app-ab00.marketo.com", "785-UHP-775", 1057);
// Find the button element that you want to attach the event to
var btn = document.getElementById("MyAlternativeSubmitButtonId");
btn.onclick = function() {
// When the button is clicked, get the form object and submit it
MktoForms2.whenReady(function (form) {
form.vals({
"FirstName": $('#first').val(),
"LastName": $('#last').val(),
"Email": $('#email').val(),
"Phone": $('#phone').val()
});
form.submit();
});
};
If you submit the records via API or FTP, you don't get all the awesome Known Visitor tracking being activated, or the ability to trigger journeys off a form fill activity.
Cheers
Jo
I definitely support using the Forms 2.0 JS API in every possible case, like Jo says.
But you can get Munchkin-associated sessions when you use the Submit Form API. That part does work, if the cookie is part of the input.
The Submit Form API is a lot less scalable than the Forms 2.0 JS API. On a busy site the Submit Form API, if not otherwise policed, will overwhelm your API calls.
There’s no such thing as FTP uploads into Marketo. You certainly can write an app that periodically pulls lists from an FTP/SFTP server and then pushes them into Marketo using the API. But that kind of periodic pull-translate-push (basically a mini-ETL process) runs counter to the idea of form fills showing up promptly in the production database. Of course it is possible, but I would challenge such a design quite strongly given that the JS API is right there for you.
Hi @Jo_Pitts1!
Thanks for the suggestion. I'm doing something similar myself. However, I'd like to prevent any default actions from the form.submit (page reload) and instead do something of my own (our codebase uses React). Do you have any tips about this?
2) Additionally, my team uses the progressive profiling feature from Marketo, and I was wondering if there's a way to know if the user was already registered using the Forms 2.0 API. Do you know of a way?
Thank you in advance.
why would a page reload be an issue? The Marketo form's form.submit() should only get called based on the visible form's submit button being clicked.
As to progressive profiling, you could do a form pre-fill into the hidden form (read this article - https://blog.teknkl.com/pre-fill-any-site-any-form/), then use that to determine which fields to display in your custom front end form.
Cheers
Jo
doing something similar myself. However, I'd like to prevent any default actions from the form.submit (page reload) and instead do something of my own (our codebase uses React). Do you have any tips about this?
Merely return false from an onSuccess listener and you can do whatever you want. The default behavior (redirect to the Thank You URL) will be prevented.
MktoForms2.whenReady(function(mktoForm){
MktoForms2.onSuccess(function(submittedValues,thankYouURL){
// do whatever
return false;
});
});
2) Additionally, my team uses the progressive profiling feature from Marketo, and I was wondering if there's a way to know if the user was already registered using the Forms 2.0 API. Do you know of a way?
Not clear exactly what you mean by “registered” here. There’s no method that specifically tells you if the Munchkin cookie and/or pageview was already associated with a known lead.
However, if ProgPro is enabled, and if any field after the first block of fields is found in the DOM, you know they must’ve been already associated.