Linking directly to a Marketo Form in a email

Amir_Saint1
Level 1

Linking directly to a Marketo Form in a email

I have a marketo form on a webpage, the form is hidden behind a button that says "GET MORE INFO" when that button is clicked, the Marketo form appears for the user to fill out.

I have an email that will be sent to a group of people and in that email there is a link where I want people to click on to direct them to the webpage, but when they click on this link I want them to go directly to the form, not the "GET MORE INFO" button.

How do I do this?

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Linking directly to a Marketo Form in a email

Whatever code you're running on button click (presumably MktoForms.loadForm) check to see if the query string contains mkt_tok and if so, run that same code immediately on page load.

Amir_Saint1
Level 1

Re: Linking directly to a Marketo Form in a email

Can you give me an example?

SanfordWhiteman
Level 10 - Community Moderator

Re: Linking directly to a Marketo Form in a email

Depends entirely on what you're doing to show the form right now, and you haven't provided any code nor a URL.

A ridiculously simplified example is like so:

<button class="form-visibilizer">Gimme the form</button>

<script>

function makeFormVisible(){

// whatever you're doing to make the form visible

}

if (/[?&]mkt_tok=/.test(document.location.search)) {

makeFormVisible();

} else {

document.querySelector("button.form-visibilizer").addEventListener("click", makeFormVisible);

}

</script>