Re: Popup after submittingn theh form

Anonymous
Not applicable

Popup after submittingn theh form

Hi,

I want a youtue video popup after the form is sucessfully sumitted. I tried using the Forms2.0 customization, below are the steps I have done - 

Step 1: in a landing page using a html I am loading a form by embed method
(<script src="//app-ab07.marketo.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_1048"></form>)

Step 2: Added a script tag in the same HTML for opening a video in a popup
(<script>
MktoForms2.loadForm("//app-ab07.marketo.com", "386-ELQ-047", 1048, function(form){
  form.onSuccess(function(values, followUpUrl){
window.open("https://www.youtube.com/embed/aaabbbcccc", "PopupWindow", "scrollbars=no,resizable=no");
  });
});</script>)

As per the above steps the video is opening in a popup as expected but the issue I am facing is the form fills are not getting captured.

When I check the landing page statistics I can see the views but not the forms filled. I believe the calls are not going. Can some please let me know what I am missing here.

0EM50000000TAEZ.png

Thanks

Tags (1)
11 REPLIES 11
SanfordWhiteman
Level 10 - Community Moderator

Re: Popup after submittingn theh form

Don't use the embedded form syntax (MktoForms2.loadForm) on a Marketo LP.

Drag the form into the page and then, to add event handlers, use MktoForms2.whenReady,

The 2 methods are distinguished in the Forms 2.0 developer docs.
Anonymous
Not applicable

Re: Popup after submittingn theh form

Hello Sanford,

Thanks for your quick reply.

I tried that option and but nothing is happening - 

Below is the snippet I am using in the html block

<script>
  MktoForms2.whenReady(function (form){
window.open("https://www.youtube.com/embed/aaaabbbccc", "PopupWindow", "scrollbars=no,resizable=no");
  });
</script>

and tried both the options in form settings -

Selected 'Follow Up With' option and gave 'Stay On Page'. The form refreshes but the popup is not opening.

Selected 'Landing Page' option and selected a page from Marketo landing page from the list, its geting redirected to that page instead of opening the popup. 

Can you please let me know what I am missing here.

Thanks,
SanfordWhiteman
Level 10 - Community Moderator

Re: Popup after submittingn theh form

whenReady() is the equivalent of loadForm().  Try adding your form.onSuccess() listener inside of whenReady().
Anonymous
Not applicable

Re: Popup after submittingn theh form

Hello Sanford,

Used the below snippet, still no luck.

<script>
  MktoForms2.whenReady(function (form){
form.onSuccess(function(values,followUpUrl){
window.open("https://www.youtube.com/embed/ZQhpKu8YLOw", "PopupWindow", "scrollbars=no,resizable=no");
  });
</script>


Thanks,
SanfordWhiteman
Level 10 - Community Moderator

Re: Popup after submittingn theh form

Please post the URL of your landing page.
Anonymous
Not applicable

Re: Popup after submittingn theh form

Hello Sanford,

Below is the landing page in which I have a form, once the user fills the form and submit it need to pop up a video.

http://marketing.xxx.com/Nurture_2_test.html.

I have another landing page which I have linked in the form settings for testing purposes. Hope this helps.

Please do let me know if you need anyother information.

Thanks,
SanfordWhiteman
Level 10 - Community Moderator

Re: Popup after submittingn theh form

I meant the actual URL. Unless you are working for that porn site, which is fine, but the page does not exist.
Anonymous
Not applicable

Re: Popup after submittingn theh form

Hello Snford,

Below is the main Landing Page URL

http://marketing.phillips66lubricants.com/76_gostrong.html

URL for the popup video: https://www.youtube.com/embed/ZQhpKu8YLOw

hope this helps

Thanks
SanfordWhiteman
Level 10 - Community Moderator

Re: Popup after submittingn theh form

[a] You are not using whenReady() on that landing page now.

[b] You are still trying to use loadForm() but the call to MktoForms2.loadForm() actually appears in the HTML before the Mkto forms.js is loaded, hence the loadForm() fails (you can see this in your Web Console).