I am wondering if there is a way for a anon lead to be tag as known and I have found this.
A Munchkin associateLead call must be sent to your Marketo instance.
Do you have any idea how to do this?
Any answer will be greaty appreciated
and you will need the person's email anyway.
You might also want consider filling a form in the background, which also requires JS too. Make a Marketo Form Submission in the background
What is your use case ?
Also please read this blog post: http://blog.teknkl.com/generating-munchkin-associator-tokens-in-sfdc-apex-or-flowboost-js/
associateLead is not a purely client-side function: associator tokens use a secret key, so they need to be generated on a server.
Is they visit your web site and you do not know who they are, then you do not know their email address, so you cannot run any of the methods above.
If they browse your website and you know who they are, then it's because they already have beed associated, in which case running these JS is useless.
Sorry for the bad news.
Jas, if someone uses a non-Marketo form to identify themselves, in theory that would be the typical case in which you'd use associateLead -- you know who they are via other means and you want to tell Marketo.
However in the specific case of a non-Marketo form which creates an SFDC record, which in turn becomes a Marketo lead, you can't use the client-side associateLead because you'll create a duplicate (the lead created by associateLead, if it's net new, will not be the same as the lead created by the SFDC sync). In this case you instead pass the Munchkin tracking cookie (_mkto_trk) to SFDC as a hidden field, then relay it to a Marketo field, and finally call a webhook. This is the only way to protect against duplicates when your non-Marketo form uses a back-end workflow that creates Marketo leads.
The more practical way to accomplish this is by distributing Personalized URLs, a built-in Marketo feature that's different from Munchkin associator tokens.
While Munchkin tokens can accomplish the same, they're very long strings and not any better for this use case.
However, as Greg rightly notes, if you don't give them a personalized URL/promo code/etc. then they're just hitting your website anonymously, like any other member of the public, and you couldn't know who they are.