SOLVED

Grab Marketo Form in Liferay for Drift

Go to solution
oaj
Level 2
Level 2

Grab Marketo Form in Liferay for Drift

Hello,

 

We are trying to add a Marketo Form to our landing page that is using Liferay for a Drift fastlane integration. 

 

I am not sure how to grab a Marketo form outside of Marketo. I have the instance and form ID, would it just be as simple as pasting a script in the Liferay html?

 

I have added sample code with different values below on how we are trying to grab the form.

 

<!-- Drift -->
<script>
    MktoForms2.loadForm("//website.com", "658-grs-4469", 3267, function (form) {
        form.onSuccess(function (values) {
            drift.api.collectFormData(values, {
            campaignId: 5624457, // Drift playbook's campaign id!
            followupUrl: 'website.com'
            });
            return false;
        });
    });
</script>

 

Thanks,

Oscar

1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Grab Marketo Form in Liferay for Drift

I believe OP is trying to fire a Drift fast lane playbook (a full-screen chat) when a user submits the form. Upon a successful Marketo form submission, the Drift JavaScript  will collect the form data and fire the playbook. Check out this documentation on plugging Drift fastlane playbook into form workflow. @oaj ,do you see any console errors when you try this code in action? Or let us know if you’re trying to do something else. 

View solution in original post

6 REPLIES 6
Jo_Pitts1
Level 10 - Community Advisor

Re: Grab Marketo Form in Liferay for Drift

@oaj ,

are you trying to embed a Marketo form on a non Marketo landing page?  I'm a bit confused by the question.

If that is the case, just use Marketo's form embed code.  When you click on a form in the LHS treeview, you'll see a button at the top RHS called embed code.  Click it.  Copy that code into your landing page.

 

Or are you trying to send data in the Marketo form to Liferay?

 

 

Regards

Jo

SanfordWhiteman
Level 10 - Community Moderator

Re: Grab Marketo Form in Liferay for Drift

Every Marketo form has a form embed code. Not sure what else you mean by "grab".

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Grab Marketo Form in Liferay for Drift

I believe OP is trying to fire a Drift fast lane playbook (a full-screen chat) when a user submits the form. Upon a successful Marketo form submission, the Drift JavaScript  will collect the form data and fire the playbook. Check out this documentation on plugging Drift fastlane playbook into form workflow. @oaj ,do you see any console errors when you try this code in action? Or let us know if you’re trying to do something else. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Grab Marketo Form in Liferay for Drift

You wouldn't use the code above without previously including forms2.min.js. And if you include the entire embed code above this, you'd end up duplicating the form.

 

@oaj it's not recommended to use the immediate onReady listener — the 4th argument to loadForm() — unless you're very sure of what you’re doing.

 

Instead, include the standard embed code. Then after that, include a whenReady listener with your custom behavior:

MktoForms2.whenReady(function(form){
  form.onSuccess(function(values, originalThankYouURL) {
    drift.api.collectFormData(values, {
      campaignId: 5624457, // Drift playbook's campaign id!
      followupUrl: 'website.com'
    });
    return false;
  });
});

 

 

 

oaj
Level 2
Level 2

Re: Grab Marketo Form in Liferay for Drift

Yes, this is what we are trying to do. We have yet to try it. I was not sure if the embed code was all I needed to start testing or if there were more steps I was missing.

 

oaj
Level 2
Level 2

Re: Grab Marketo Form in Liferay for Drift

We did run into a console error. Has anyone encountered this error before? 

I removed our account number.

 

.b1edaf4a.chunk.js:1     POST https://targeting.api.drift.com/qualify/with_mapping/YOURAcctNumber 404 (Not Found)