We have leads that are not capturing the cookie value. Is this a normal thing? If so, what are some examples of situations when this would happen?
Thank you!
Solved! Go to Solution.
I'd be looking for bugs in the code that writes the cookie in the first place.
For example, homegrown code may have a race condition so that on pages with Marketo forms, the cookie may be written either before or after the form is rendered, giving very different results. If your code doesn't understand the Forms 2.0 event model this can easily happen.
What do you mean by "the" cookie value exactly?
Do you mean a Hidden field that's set to AutoFill from a cookie? There's no case where the cookie provably exists where this is known to fail. Do you have more evidence/audit trail about what you're describing?
The issue that sparked this question is: we have a hidden field on some of our forms that is supposed to capture the cookie value from our lead tracking code. However, these are coming in as the hidden field's default value "Null". I'm not sure how to find an audit trail.
I'd be looking for bugs in the code that writes the cookie in the first place.
For example, homegrown code may have a race condition so that on pages with Marketo forms, the cookie may be written either before or after the form is rendered, giving very different results. If your code doesn't understand the Forms 2.0 event model this can easily happen.
I don't have much experience in setting up the code that writes the cookie. I've only ever managed the instances after that set up was completed. I'll have to see how to go about it. Thanks so much Sanford for the help with this.
If you point to the page with the code I can give it a look to see if any bugs immediately jump out.
Awesome, thank you!
Here is the page where our form lives: http://innovate.ieee.org/innovate/contact-us
Sure enough, the developer doesn't understand how Marketo Forms work.
This code cannot work predictably:
$(document).ready(function() {
var a = "ieee.org";
var c = document.referrer;
var b = "LT";
var d = getUrlParameter(b);
if (typeof d != "undefined" && null != d && d != "") {
$.cookie("LT", d, { expires: 730, path: "/", domain: a });
}
});
When you wait for jQuery's ready (this is equivalent to the native event DOMContentLoaded) there's no guarantee that it will run before the Marketo form is finished drawing.
Marketo loads form descriptors (that's the technical name for the setup you manage in Form Editor) and injects HTML elements asynchronously. It doesn't wait for ready before beginning this process.
Therefore, depending on network conditions, caching, and other remote assets loaded by the page, the cookie code might run either before or after the form is ready for use. If it runs after, there are no cookies for the form to see.
This code should run synchronously, i.e. not wrapped in ready.
I am super appreciative of the time and effort you put into this! This is super helpful and I will work to get this fixed ASAP.
Hi Sanford,
Not sure if you have any insight on this.
I noticed this form is not pulling in the LT value from the url. I made sure to clear my cache and when I test it, it doesn't pull in the LT value: Testing1. Any idea why this is happening?
My field is set up like this:
Thank you
Danielle