It's the Sanford Whiteman profile btw. (You @'d one of my secondary profiles, where my name is unfortunately misspelled!)
When consent is granted, you could make a hidden form post with just the DateConsented field (you really only need one datetime field to record this, since an empty datetime is akin to a boolean false).
But this is only straightforward when the Munchkin session is already associated with a named lead in your database.
The session will be associated if they clicked a link in an email (even if it's a brand-new Munchkin session that just started) or if they've previously filled out a form. So those cases are fine.
But if they've merely clicked a public ad, organically found your site, etc. the session is still anonymous. Anonymous sessions must be presented w/the cookie popup, but you won't know who they are yet, so there is no place in the database to save the changes at that point. That is, unless you want to create a named lead with no email address and merge the real email address in later -- things get very complex with this approach, as well as potentially costly as all such leads count against your subscription.
In lieu of the form post, you can use the Munchkin API associateLead function to pass field values (you have to generate a Munchkin associator token to do this, though, which adds development overhead). This is more efficient than a form post, but has the same catch as above. If the person is in your db, or you have enough info to add them to your db, then saving the value is easy. But it's not generally practical to save data to the Marketo database if you don't know who someone is (i.e. their Email Address) yet.
It would make more sense to have a Smart Campaign that triggers when the lead is created or merged via normal means and populates the field then. This, however, works better with Munchkin 2.0 (which you probably aren't on yet) than with Munchkin 1.x. There's no one-size-fits-all solution and I suggest you get a developer who knows Munchkin inside and out to talk about the options for your particular case. Some approaches use a combination of cookies, invisible forms, and webhooks to "replay" a lead's anonymous actions onto the now-known lead.
Sorry for the misspelling.
Ok, I got your point, I thought the lead was created automatically as unknown in the database (when it's the first time they reach my environment) and so I could add a consent and consent date regarding the IP address and it will automatically merge to the additional info whenever the lead fills out a form for the first time. I thought that because when I erase my cookies and navigate then fills a form it sounds marketo do not make mistake on associating my IP address and history to my email address.
Maybe the other way around would be to add into the cookies the consent and consent date the first time the lead visits the website and push this info into all form so it get pushed the first time he will fill out the form, what do you think about this solution? Do you have an idea how to code it please?