Is it possible to get the form name (the name that is in Marketo) by using the form ID and the Forms 2.0 API? For example:
MktoForms2.loadForm("//app-sj14.marketo.com", "xxx-xxx-xxx", 2146, function(form){
var name;
name = form.name;
return name;
});
Any thoughts would be appreciated?
Solved! Go to Solution.
Is it possible to get the form name (the name that is in Marketo) by using the form ID and the Forms 2.0 API? For example:
Officially, no.
You can access the name from the descriptor if you manually load it as discussed in my blog post: http://blog.teknkl.com/smoothing-embedded-marketo-form-loads/
However, note the name (unlike the ID) is not unique over time. I'm also not sure what you're trying to do with this information, since Marketo already makes the form name known as {{trigger.name}}.
Is it possible to get the form name (the name that is in Marketo) by using the form ID and the Forms 2.0 API? For example:
Officially, no.
You can access the name from the descriptor if you manually load it as discussed in my blog post: http://blog.teknkl.com/smoothing-embedded-marketo-form-loads/
However, note the name (unlike the ID) is not unique over time. I'm also not sure what you're trying to do with this information, since Marketo already makes the form name known as {{trigger.name}}.
Hi Sanford,
Thank you for your response. I want to capture the name as a variable and send it over to Google Analytics through GTM for tracking purposes. When you say, {{trigger.name}}, what do you mean? Is this something like form.trigger.name?
Sorry if this is silly question, but what's a short example that accesses the form name using the Forms API?
{{trigger.}} tokens can be used in Flows. They can't be used from the client side, though, so you could only supply them to GA if you logged using a webhook (not a bad idea given the additional context you can provide).
I'll answer your question on my blog if you leave a comment there. It's really far from supported stuff so I don't think it should be directly on the Nation.