SOLVED

Re: Hiding web elements for known person

Go to solution
Jo_Pitts1
Level 10 - Community Advisor

Hiding web elements for known person

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Hiding web elements for known person

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.

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Hiding web elements for known person

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
Level 10 - Community Advisor

Re: Hiding web elements for known person

@SanfordWhiteman,

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

Cheers

Jo

SanfordWhiteman
Level 10 - Community Moderator

Re: Hiding web elements for known person

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.