Check if lead on page is known | Community
Skip to main content
May 23, 2017
Solved

Check if lead on page is known

  • May 23, 2017
  • 1 reply
  • 2558 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

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.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
May 23, 2017

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.

May 23, 2017

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?

SanfordWhiteman
New Participant
May 23, 2017

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.