SOLVED

Embedded form not showing since updates

Go to solution
Jonathan_Haines
Level 2

Embedded form not showing since updates

Has anyone had issues with embedded forms not showing?
- Our CNAME is set and the code has been updated appropriately.

- We have an SSL certificate set on our Marketo assets, so it shouldn't be a mixed content issue.
It shows on the backend of our website but not the front end. I have been going back and forth with Marketo support for almost two days with no progess, so looking to see if anyone else has experienced this and found a solution.

 

Thanks!

Jonathan Fox-Haines
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Embedded form not showing since updates

Not much of a mystery here!  The cause is straightforward.

 

Checking your F12 Console, you'll see this error:

 

2021-02-08 15_29_40-Contact Data Dimensions _ Call +1 800.782.2907.png

 

That's because you're trying to use the global MktoForms2 object before it exists. And the reason it doesn't exist is you've added the defer attribute to the script tag (it's not there by default):

 

 

<script src="//go.datadimensions.com/js/forms2/js/forms2.min.js" defer></script>

 

 

 

defer — by design — does not load the script immediately, instead deferring it to a background fetch.

 

This means in the very next inline <script>, when you try to run MktoForms2.loadForm, it fails. This is expected behavior.

 

While defer means loading an external JS file won't block rendering of your page, it also means you need your code to be aware that you're defer-ing.  You can't just add in that attribute without potentially upsetting things.

 

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Embedded form not showing since updates

You will have to provide a link for someone to see what you're seeing.

Jonathan_Haines
Level 2

Re: Embedded form not showing since updates

The page it is supposed to be showing on is https://datadimensions.com/contact/.

 

The form that you do see is NOT a Marketo form because we have to have a functioning form available.

Jonathan Fox-Haines
SanfordWhiteman
Level 10 - Community Moderator

Re: Embedded form not showing since updates

Not much of a mystery here!  The cause is straightforward.

 

Checking your F12 Console, you'll see this error:

 

2021-02-08 15_29_40-Contact Data Dimensions _ Call +1 800.782.2907.png

 

That's because you're trying to use the global MktoForms2 object before it exists. And the reason it doesn't exist is you've added the defer attribute to the script tag (it's not there by default):

 

 

<script src="//go.datadimensions.com/js/forms2/js/forms2.min.js" defer></script>

 

 

 

defer — by design — does not load the script immediately, instead deferring it to a background fetch.

 

This means in the very next inline <script>, when you try to run MktoForms2.loadForm, it fails. This is expected behavior.

 

While defer means loading an external JS file won't block rendering of your page, it also means you need your code to be aware that you're defer-ing.  You can't just add in that attribute without potentially upsetting things.

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Embedded form not showing since updates

@Jonathan_Haines please come back and check your thread, thanks.