SOLVED

Values from Cookies not stored in hidden fields

Go to solution
Frank_Geldof1
Level 4

Values from Cookies not stored in hidden fields

Hi Everyone,

We have occasional issues with values stored in cookies not being stored in hidden fields on form submit. Sometimes the information in the cookies are stored and sometime they are not.

Support is trying to help but I am wondering if anyone has any insight on how to trouble shoot.

Setup:

1. We store utm values in cookies when people come to our site.

2. When the user converts via a Marketo LP  we auto fill the hidden fields with values from set the cookies.

We have tested in multiple browsers (normal and incognito modes) and always the cookies are set but on submission the values are not always stored.

Any ideas?

Thanks in advance,

- Frank

/// Frank
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Values from Cookies not stored in hidden fields

You must either:

  1. Ensure the form only loads after the cookie has been created, since the built-in Hidden Autofill runs on form load; or
  2. Populate the hidden field using addHiddenFields() when the form submits, which is the last possible moment and it's assumed the cookie exists by then.

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Values from Cookies not stored in hidden fields

You must always (always) supply your URL for questions like this.

We have no idea what code you're using to store and retrieve data from cookies, and when you're running that code; plenty of such attempts are broken due to race conditions or other implementation flaws.

Also, "on submission the values are not always stored" needs more precision. Does "stored" mean saved to the Marketo database? Or does it mean posted to the Marketo database? (Not the same thing.)

Frank_Geldof1
Level 4

Re: Values from Cookies not stored in hidden fields

Thanks for the reply Sanford. I was hoping for some pointers to investigate myself hence the reason I did not share a link.

/// Frank
sarahingle88
Level 1

Re: Values from Cookies not stored in hidden fields

Hi Frank,

 

This is what we too are experiencing. We are trying to store Google's client ID from the _ga cookie using a hidden field. Sometimes it works and sometimes it doesnt..... did you ever figure out the cause for the intermittent tracking?

 

Thanks so much!

Sarah 

SanfordWhiteman
Level 10 - Community Moderator

Re: Values from Cookies not stored in hidden fields

You must either:

  1. Ensure the form only loads after the cookie has been created, since the built-in Hidden Autofill runs on form load; or
  2. Populate the hidden field using addHiddenFields() when the form submits, which is the last possible moment and it's assumed the cookie exists by then.