Is it possible to use a token for a form element? | Community
Skip to main content
May 27, 2016
Question

Is it possible to use a token for a form element?

  • May 27, 2016
  • 2 replies
  • 3169 views

I've started experimenting with a tokenized version of my landing page template.

So far I've just been using Text and Rich Text token types, but I'd like to know if there a way to use a token for selecting a form.

Thanks.

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

2 replies

Jim_Thao7
Level 8
May 27, 2016

Not aware of any Forms token or any Marketo asset tokens for that matter.

What you can try is:

- You can embed a form into a Rich Text token and then use the Rich Text token.

- You can create a landing page w/ the form on it and then reference that landing page using a Rich Text or Text token (depending on how you code the container)

May 27, 2016

Thanks @Jim Thao.

What I've ended up doing is pulling in the embed code from one of the forms and then replaced the ID number with number tokens:

<script src="//app-ab16.marketo.com/js/forms2/js/forms2.min.js"></script>

<form id="mktoForm_{{my.Form ID#}}"></form>

<script>MktoForms2.loadForm("//app-ab16.marketo.com", "335-QLG-882", {{my.Form ID#}});</script>

I think the only downside of this method is that the person customizing the program's token values would need to know the ID of the form ahead of time.

Thanks again for your reply.

SanfordWhiteman
Level 10
May 27, 2016

If this is for a Marketo-hosted LP, there is a significant downside because you have severed the connection between the form and the LP and will not see LP-level conversion counts. If you are okay with that it's a fine method. However, I recommend you use actual form elements.

May 31, 2016

@Sanford Whiteman, @Edward Unthank:

Thanks a lot for your suggestions and taking the time to explain your process.

In order to reap the most benefit from Marketo's reporting (landing page conversion counts, as Sanford Whiteman mentioned), it sounds like I'd be better off not using my method of number tokens for embedding a form. As the developer (not the marketing team) this seemed like a good idea, but the issues you raised have made me reconsider my approach so the marketing team has access to as much reporting as possible.

That said, I'm planning on un-tokenizing the form element and adding a form variable:

<div id="dmack_form" mktoName="Form Placeholder" class="mktoForm">

Is this essentially what you are advocating?

Cheers

SanfordWhiteman
Level 10
May 31, 2016

Yes, and that's the equivalent of dragging a form element to the Free-form LP canvas. In both cases the form asset is linked to the LP.

If you wanted to enforce a particular form (so the end-user can't browse all forms) there are some tricks to do that. When I have the time I'll write them up on my blog.