SOLVED

Embed a Marketo form in Wordpress page

Go to solution
ColinWhite_CP
Level 1

Embed a Marketo form in Wordpress page

Hi - migrating from HubSpot to Marketo, and we have a number of HubSpot forms embedded on Wordpress pages that we want to replace with Marketo forms. Was hoping to be able to simply swap in the Marketo form embed code in Wordpress. When I do this, the Marketo form initially appears and seems to accept submissions while I am logged in to WP, but when I switch browsers or log out of WP, the Marketo form does not appear on the page. At first I thought this might be an SSL issue but I confirmed we have SSL enabled for our Marketo instance.   Was hoping for suggestions here for obvious things to try before getting our web developers involved.  Here's an example of the non-working form in staging:

https://cyberpionstage.wpengine.com/cyberpion-demo-request-marketo-form/

 

Thx!

1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Embed a Marketo form in Wordpress page

I think the best course of action here would be to highlight this to your WP dev team so that they can ensure the forms2 JS loads on the webpage. Everything is looking sunny at the Marketo's end, it's just that the forms2 JS needs to be included on the webpage for the Marketo form to load. 🙂

 

View solution in original post

8 REPLIES 8
Dave_Roberts
Level 10

Re: Embed a Marketo form in Wordpress page

Hey Colin,

 

All Im seeing come thru on the example link you shared is the web URL to a page in Marketo -- it doesn't look like any of the actual form stuff is in there.

 

There should be an embed code you can get for just the form itself from within Marketo and then you can put that code snippet into WP in a "custom HTML" block and it should render the form for you that way.\

 

Here's a link to the docs that walk thru how to get/add the code snippet to embed forms from Marketo:

https://experienceleague.adobe.com/docs/marketo/using/product-docs/demand-generation/forms/form-acti...

 

Here's a look at an example of the HTML you should be copy/pasting into your WP page to get it to come thru on that end:

Marketo Form Embed Code Reference | source: https://experienceleague.adobe.com/docs/marketo/using/product-docs/demand-generation/forms/form-actions/embed-a-form-on-your-website.htmlMarketo Form Embed Code Reference | source: https://experienceleague.adobe.com/docs/marketo/using/product-docs/demand-generation/forms/form-actions/embed-a-form-on-your-website.html

ColinWhite_CP
Level 1

Re: Embed a Marketo form in Wordpress page

Thx for looking - I must have been playing with it when you looked, I have the form embed code on that page now:

Cyberpion Demo Request - Marketo Form Test | Cyberpion (wpengine.com)

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Embed a Marketo form in Wordpress page

You're not loading the forms2.0 JS on your webpage, or may be it's getting stripped off by the WP smh? 

Darshil_Shah1_0-1658167208253.png

 

Add the below line in the head of the webpage (or before you load the form) to include the forms2 JS.

 

 <script type="text/javascript" src="//go.cyberpion.com/js/forms2/js/forms2.min.js"></script>

 

Once included, you should see the Marketo form on page - 

Darshil_Shah1_1-1658167376956.png

 

ColinWhite_CP
Level 1

Re: Embed a Marketo form in Wordpress page

That line is already included in the embed code I am pasting in from Marketo. Perhaps it is getting stripped out somehow? Strange how the form is appearing while I am logged in to Wordpress, but not otherwise. 

Jo_Pitts1
Level 10 - Community Advisor

Re: Embed a Marketo form in Wordpress page

@ColinWhite_CP ,

I've come across WP instances that strip JS code out.

Could that be the case here?

Cheers

Jo

ColinWhite_CP
Level 1

Re: Embed a Marketo form in Wordpress page

Yes it definitely could be the case here. Thx

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Embed a Marketo form in Wordpress page

I think the best course of action here would be to highlight this to your WP dev team so that they can ensure the forms2 JS loads on the webpage. Everything is looking sunny at the Marketo's end, it's just that the forms2 JS needs to be included on the webpage for the Marketo form to load. 🙂

 

MannyPerez
Level 2

Re: Embed a Marketo form in Wordpress page

I just recently ran into this same issue and the problem ended up being super simple.

 

Marketo's form embed code doesn't include (https:) before the (//) in the URLs within the script, therefore our WP was blocking it.

Simply adding that into the URL solves the issue, at least in our case. Hope that helps someone out, thanks!