SOLVED

Re: Get Form name from Forms 2.0 API?

Go to solution
Anonymous
Not applicable

Get Form name from Forms 2.0 API?

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?

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Get Form name from Forms 2.0 API?

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}}.

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Get Form name from Forms 2.0 API?

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}}.

Anonymous
Not applicable

Re: Get Form name from Forms 2.0 API?

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?

SanfordWhiteman
Level 10 - Community Moderator

Re: Get Form name from Forms 2.0 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.