Hiding web elements for known person | Community
Skip to main content
Jo_Pitts1
Community Advisor
Community Advisor
May 31, 2022
Solved

Hiding web elements for known person

  • May 31, 2022
  • 1 reply
  • 1535 views

Hiya all,

Has anyone got a way of hiding (and for that matter showing) non Marketo web elements based on someone being a known person in Marketo?

 

Cheers

Jo

 

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

First — for the lurkers — we mean “(a) the current pageview or (b) the stored Munchkin cookie in the current browser session is directly associated with one existing person in your Marketo instance.”

 

The answer is to use Known Visitor HTML (KV HTML) and a hidden form. When the form is ready (whenReady) you can check if the KV HTML is present in the DOM; alternately (though I find this a bit messy) you can put JS in the KV HTML block itself. Either mark up the body tag with a special CSS class or take any other action you want using JS.

 

Naturally this assumes the elements on the page have already been prepared to be shown/hidden using this method. You might even be using a client-side template framework and not inject certain elements unless you’re in known mode.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
May 31, 2022

First — for the lurkers — we mean “(a) the current pageview or (b) the stored Munchkin cookie in the current browser session is directly associated with one existing person in your Marketo instance.”

 

The answer is to use Known Visitor HTML (KV HTML) and a hidden form. When the form is ready (whenReady) you can check if the KV HTML is present in the DOM; alternately (though I find this a bit messy) you can put JS in the KV HTML block itself. Either mark up the body tag with a special CSS class or take any other action you want using JS.

 

Naturally this assumes the elements on the page have already been prepared to be shown/hidden using this method. You might even be using a client-side template framework and not inject certain elements unless you’re in known mode.

Jo_Pitts1
Community Advisor
Jo_Pitts1Community AdvisorAuthor
Community Advisor
May 31, 2022

@sanfordwhiteman,

thanks for this.  It feels awfully clunky, but I guess there is no way around it.

Cheers

Jo

SanfordWhiteman
Level 10
May 31, 2022

It’s gonna be the only supported way. In the past I used the /getKnownLead endpoint directly but given the way the library has evolved that would be too risky now.