I was recently tasked with building some landing pages in Marketo for a client. They chose Marketo so that they could track conversions and record submissions from the embedded form.
I’d built landing pages in the past with no real problems, that was until now. In summary, on my landing page I had a small jQuery countdown timer that would count down the hours, minutes and seconds to a particular event.
When building the landing page template in HTML, it worked absolutely fine and the countdown clock ticked down the seconds.
I needed to figure out why the HTML would work fine outside of Marketo, but then stop as soon as it’s added into a landing page.
Finding a Solution
The first thing I noticed was that when editing pages within Marketo, the pages are all served over HTTPS. From previous experience I knew that loading files from a HTTP source over HTTPS would result in security warnings.
After changing the ‘src‘ attribute to begin with ‘https‘ I tried again, alas still to no avail.
Based on my findings above, I concluded that there are two solutions to fixing this problem:
In my scenario, because the situation was quite a rare one, I went for the second option and placed the JS code directly within the HTML. Once I’d done this the jQuery countdown time began to work immediately as expected.