Test if a Lead is Logged in with "MBB.data.lacid"
Sometimes you may want to display specific content for website visitors who are not logged in to a Buying Buddy account, and then to display alternate content for leads who are logged into their accounts.
For example, Offer a PDF download on a page that shows a registration form if the lead IS NOT logged in - or the download link if the lead IS logged in.
The following JavaScript snippet demonstrates how you can perform this test.
This JavaScript ensures that this code will load after the Buying Buddy Plugin has loaded.
document.addEventListener("mbb-widgets-loaded", function() { if (MBB.data.lacid) { // do this } else { // do that } });