SOLVED

Re: What are some examples for when a Cookie Value will be empty when a lead fills out a form?

Go to solution
Dan_Stevens_
Level 10 - Champion Alumni

Re: What are some examples for when a Cookie Value will be empty when a lead fills out a form?

Danielle - if you're looking to pull the LT value from the URL you shared, this is a "URL Parameter", not a "Cookie Value".  Have I overlooked the fact that you have also stored this as a cookie value?

Danielle_Wong
Level 8 - Community Advisor

Re: What are some examples for when a Cookie Value will be empty when a lead fills out a form?

Hi Dan,

Thanks for the reply. I believe we've used cookie value because we want to make sure that if someone browses our website, the lead tracking follows them. It's my understanding that if we use URL, that parameter doesn't follow the user.

We have code that captures the cookie as LT. It's in Sanford's reply above.

Thanks!

Danielle

SanfordWhiteman
Level 10 - Community Moderator

Re: What are some examples for when a Cookie Value will be empty when a lead fills out a form?

The page still has the same problem I outlined above. You can't set cookies in jQuery.ready(), because that can fire after the Marketo form is loaded, hence Marketo will not see the cookie when it needs to.

Remember, the Forms 2.0 event model (whenReady, etc.) exists for a reason. You can't use the browser's generic event model to determine when the form is ready.

Danielle_Wong
Level 8 - Community Advisor

Re: What are some examples for when a Cookie Value will be empty when a lead fills out a form?

Hi Sanford,

Thank you. I will have my web developer take a look at it!

Just so I understand the entire lead tracking process. We should be using "URL parameter" in our hidden lead tracking field? And the cookies code on the page should pull in any cookies if the lead happens to browse other pages before filling out a form?

Thanks

Danielle

Danielle_Wong
Level 8 - Community Advisor

Re: What are some examples for when a Cookie Value will be empty when a lead fills out a form?

Hi Sanford,

Would you mind taking a look at the page again? The developer made an

update to the code. I’m not sure how to ensure it’s working as expected.

Any tips on testing it?

Thanks

Danielle

On Wed, Mar 14, 2018 at 2:20 PM Sanford Whiteman <

SanfordWhiteman
Level 10 - Community Moderator

Re: What are some examples for when a Cookie Value will be empty when a lead fills out a form?

Looks the same to me -- it still only sets the cookies inside jQuery.ready(), which won't work

Danielle_Wong
Level 8 - Community Advisor

Re: What are some examples for when a Cookie Value will be empty when a lead fills out a form?

Hmm, that's weird. I don't see the jQuery.ready() on the page. Are you able to clear your cache?

I think the new code has the jQuery.ready removed. But let me know if that's not the case. Thank you so much for the help!!

SanfordWhiteman
Level 10 - Community Moderator

Re: What are some examples for when a Cookie Value will be empty when a lead fills out a form?

pastedImage_0.png