iPhone issue with Marketo forms

Jenni_Waggoner
Level 1

iPhone issue with Marketo forms

Only on iPhones, Marketo forms on landing pages are appearing twice & the dependent field isn't showing when its conditional radio button is checked. We are not seeing issues on desktop or on Android phones, just iPhones. 

 

We were able to 'fix' this by removing Google Tag Manager code from the landing page, but we need to have GTM code on our pages so this is just a temporary fix.

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: iPhone issue with Marketo forms

Clearly the problem is in code you're conditionally including via GTM. 

 

Provide a link to your page, it's not possible to debug otherwise.

Jenni_Waggoner
Level 1

Re: iPhone issue with Marketo forms

Thank you for your quick response! 

 

Here's the page with the GTM code (we made a copy of the page & template for testing). This uses the same form as the production page, it just has a different image & text: https://lp.tangohealth.com/2020-03-12-00AllCREMWSAWRClient-Referral_TEST---Client-Referral-LP.html

 

Here's the page we're using in production without the GTM code (& without the form issue): https://lp.tangohealth.com/2020-refer-hr-friend.html

 

SanfordWhiteman
Level 10 - Community Moderator

Re: iPhone issue with Marketo forms

The behavior you're describing as an "iPhone issue" in fact presents in a regular desktop browser as well, and for a very clear reason: you have this almost absurdly fragile and buggy JS on your LP:

 

$('body:contains("mkto.form.listener.html")').each(function(){
  $(this).html($(this).html().split("mkto.form.listener.html").join(""));
});

 

This code literally rewrites the body HTML if certain matching text content is found. And that content is injected asynchronously by GTM, so the behavior may or not present on a given pageview, based on network timing at that moment.

 

Reinjecting the HTML in turn re-runs local <script> content inside it. So you get a duplicate form injected inside the existing container.

 

You need to get that code out of there and seriously question whoever thought that was a good approach. I am hopeful that it was a slapdash attempt to get something out the door and that person knows better.

 

I have to say, haven't seen anything this absurd in a long while.

 

SanfordWhiteman
Level 10 - Community Moderator

Re: iPhone issue with Marketo forms

@Jenni_Waggoner please check my response above and mark it as correct, thanks.