I'm looking for a simple way to run JavaScript on any page to tell us if the visitor is known. I'm thinking it would likely be some sort of Munchkin value as to whether the visitor is associated, but I can't seem to find anything in the documentation. My only other idea is via the known visitor behavior in the forms, but I would rather not have to load up a form for this.
Solved! Go to Solution.
There's no supported to way to get this info, other than using Known Lead HTML in a hidden form (in the KL HTML area itself, add a <script> to set a JS variable or call a function, so you don't need to poll the HTML markup or anything like that).
The unsupported way is to query the /getKnownLead endpoint directly but even with all the crazy things I do with Munchkin and Forms 2.0, that's something I stay away from because it could change without notice.
There's no supported to way to get this info, other than using Known Lead HTML in a hidden form (in the KL HTML area itself, add a <script> to set a JS variable or call a function, so you don't need to poll the HTML markup or anything like that).
The unsupported way is to query the /getKnownLead endpoint directly but even with all the crazy things I do with Munchkin and Forms 2.0, that's something I stay away from because it could change without notice.
Would there be any potential problems loading a dummy form in a hidden element and running a query for whether or not it's showing up as a known lead?
No problem exactly, but "running a query" implies polling the DOM -- that's not really necessary because you can use a script in the KL HTML (i.e. in the Rich Text area) to set a value. Then check for the value in MktoForms2.whenReady.