SOLVED

Lightbox form on non-Marketo page - if Known Visitor hide form and have a CTA button that takes to a PDF stored within Marketo

Go to solution
Mike_TS
Level 2

Lightbox form on non-Marketo page - if Known Visitor hide form and have a CTA button that takes to a PDF stored within Marketo

We are using an embedded lightbox form - 1 form, many CTA buttons that trigger same form. I have it working where the form is submitted and passes values from the CTA href to hidden fields on the form to produce the proper asset on form success, but am wondering if it is possible that if a visitor clicks on another CTA that uses the same form, they are technically a Known Visitor and therefore just get a "Nice to see you again - here's your asset" button to click to be taken to the asset? I know embedding a form lacks certain capabilities then if on a Marketo LP - would this scenario be one of those?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Lightbox form on non-Marketo page - if Known Visitor hide form and have a CTA button that takes to a PDF stored within Marketo

This will work fine: both Known Visitor HTML and Progressive Profiling work on non-Marketo LPs. What doesn't work (natively) is Pre-Fill.

View solution in original post

10 REPLIES 10
SanfordWhiteman
Level 10 - Community Moderator

Re: Lightbox form on non-Marketo page - if Known Visitor hide form and have a CTA button that takes to a PDF stored within Marketo

This will work fine: both Known Visitor HTML and Progressive Profiling work on non-Marketo LPs. What doesn't work (natively) is Pre-Fill.
Mike_TS
Level 2

Re: Lightbox form on non-Marketo page - if Known Visitor hide form and have a CTA button that takes to a PDF stored within Marketo

Any additional insight as to how to make it work, because right now KV and PP are not working? I have searched various threads, but haven't seen exactly what we need.

SanfordWhiteman
Level 10 - Community Moderator

Re: Lightbox form on non-Marketo page - if Known Visitor hide form and have a CTA button that takes to a PDF stored within Marketo

You need to provide more information about your setup (screenshots) and a link to your page.

Mike_TS
Level 2

Re: Lightbox form on non-Marketo page - if Known Visitor hide form and have a CTA button that takes to a PDF stored within Marketo

Sorry - on internal staging so no page to share. Attached is a screen walkthrough essentially: click button > form appears > fill out form > goes to asset ... Refresh page > click button > form appears again. I have the form setup to just show the default KV Custom HTML greeting in Form2.0, but will also be changing that, but one thing at a time.

screen-gif.gif

SanfordWhiteman
Level 10 - Community Moderator

Re: Lightbox form on non-Marketo page - if Known Visitor hide form and have a CTA button that takes to a PDF stored within Marketo

OK, but keeping your page secret means it’s impossible to troubleshoot.

 

A form submit will result in an associated Munchkin cookie (assuming, of course, you’re running and init-ing Munchkin on the page). As soon as the association is complete, KV HTML will be displayed in place of the form, as you can see here.

 

Note association is not instantaneous and may take several seconds. During that brief period, a refresh would not be expected to show KV HTML.

Mike_TS
Level 2

Re: Lightbox form on non-Marketo page - if Known Visitor hide form and have a CTA button that takes to a PDF stored within Marketo

Understood - org rules, not mine.

Munchkin is on all pages, and even when filling out the form and surfing around the site and coming back, waiting for page load and then some - form still appears.

SanfordWhiteman
Level 10 - Community Moderator

Re: Lightbox form on non-Marketo page - if Known Visitor hide form and have a CTA button that takes to a PDF stored within Marketo

Sounds like you have Munchkin config’d incorrectly in some way. Also make sure you’re not trying to run stuff on localhost. Can’t give more help without a live page. You could even put the form embed + Munchkin on CodePen to show that it works.

Mike_TS
Level 2

Re: Lightbox form on non-Marketo page - if Known Visitor hide form and have a CTA button that takes to a PDF stored within Marketo

function callback(form) {
  var arrayify = getSelection.call.bind([].slice);

  arrayify(document.querySelectorAll('.Button--primary')).forEach(function (
    link
  ) {
    link.addEventListener('click', function (e) {
      var variantClicked = this.hash.substring(1);

      window.MktoForms2.lightbox(form).show();
      e.preventDefault();
    });
  });
}

{page?.ebook?.pdf?.url &&
                      (page?.ebook?.pdf?.is_form_modal ? (
                        <a
                          className="Button Button--large Button--primary"
                          href={page.ebook.pdf.url}
                          onClick={handleMarketo}
                        >
                          Download now
                        </a>
                      ) : (
                        <a
                          className="Button Button--large Button--primary"
                          href={page.ebook.pdf.url}
                          target="_blank"
                          rel="noreferrer"
                        >
                          Download now
                        </a>
                      ))}


const handleMarketo = (e) => {
    e.preventDefault();
  };

<Script
            id="marketoForm"
            src="//huddle.teamsnap.com/js/forms2/js/forms2.min.js"
            onLoad={() => {
              setMarketo({
                marketo: window.MktoForms2.loadForm(
                  '//huddle.teamsnap.com',
                  '395-LIR-201',
                  1255,
                  callback
                ),
              });
            }}
          />

Code is in no particular order, but this is what I got that shows how the lightbox is firing, and KV is not working.

SanfordWhiteman
Level 10 - Community Moderator

Re: Lightbox form on non-Marketo page - if Known Visitor hide form and have a CTA button that takes to a PDF stored within Marketo

That code can't show anything because it doesn't even include Munchkin. It's also invalid HTML.

I suppose I'll turn it into something that's actually runnable and put it on my own CodePen.