SOLVED

Re: Best way to use forms for on-demand webinars

Go to solution
Karen_Black
Level 5

Best way to use forms for on-demand webinars

Need your "Marketo" expertise on the following scenario.  We are looking at posting our on-demand webinars behind a Marketo form.  We would like to be able to use one form which we would embed on our website.  We need to be able to track which webinar they were interested in so that we can send an email with the link to it.  Once the form is submitted, we need take them to the video page.  Any suggestions on how to do this, if it is even possible?  Thank you so much for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Best way to use forms for on-demand webinars

It’s totally possible, pretty easy really.

 

Have a Marketo field Next Webinar URL. Add that to the form as the hidden field. Populate it using page variables (stored in your CMS). So the output would be like:

{
  let thisWebinarURL = "https://www.example.com/view/webinar/page.html";

  MktoForms2.whenReady(function(mktoForm){
    mktoForm.setValues({
       nextWebinarURL : thisWebinarURL
    });

    mktoForm.onSuccess(function(submittedValues,originalThankYouHref){
      const originalThankYouURL = new URL(originalThankYouHref),
            overrideThankYouURL = new URL(submittedValues.nextWebinarURL);

      overrideThankYouURL.searchParams.set(
        "aliId",
        originalThankYouURL.searchParams.get("aliId")
      );

      document.location.href = overrideThankYouURL.href;
      return false;
    });
  });
}
    

View solution in original post

2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: Best way to use forms for on-demand webinars

It’s totally possible, pretty easy really.

 

Have a Marketo field Next Webinar URL. Add that to the form as the hidden field. Populate it using page variables (stored in your CMS). So the output would be like:

{
  let thisWebinarURL = "https://www.example.com/view/webinar/page.html";

  MktoForms2.whenReady(function(mktoForm){
    mktoForm.setValues({
       nextWebinarURL : thisWebinarURL
    });

    mktoForm.onSuccess(function(submittedValues,originalThankYouHref){
      const originalThankYouURL = new URL(originalThankYouHref),
            overrideThankYouURL = new URL(submittedValues.nextWebinarURL);

      overrideThankYouURL.searchParams.set(
        "aliId",
        originalThankYouURL.searchParams.get("aliId")
      );

      document.location.href = overrideThankYouURL.href;
      return false;
    });
  });
}
    
Karen_Black
Level 5

Re: Best way to use forms for on-demand webinars

@SanfordWhiteman you are the best!  Thank you for replying so quickly.