Trigger Guide based on dynamic data in the Pendo Snippet

Good day! I am trying to get a guide to start based on a few pieces of historical metadata that changes dynamically while the visitor is brosing the application. The fields are listed in the Account object are: "hasThreatSync", "hasThreatSyncEnabled", and "selectedId".

Our application is a Multi-tier Multi-Tenant SaaS application Portal where a visitor logs into their Tier-1 Service Provider Account and pivot into child accounts regularly. It is during the pivots into other accounts where the above 3 values change. 

I created a piece of Code that tests 2 of those values on Guide Load to determine if they should proceed to the subsequent guide:

    var hasThreatSync = document.getElementsByClassName("_pendo-hidden-has_")[0].innerHTML;
    var hasThreatSyncEnabled = document.getElementsByClassName("_pendo-hidden-enabled_")[0].innerHTML;
    console.log (`hasThreatSync: ${hasThreatSync}`);
    console.log (`hasThreatSyncEnabled: ${hasThreatSyncEnabled}`);
    const pathname = window.location.pathname;
if (pathname.includes("sp-overview") || pathname.includes("sp-tenant")) {
        console.log("Service Provider, Bypassing");
        pendo.onGuideDismissed(); 
    }
else if (hasThreatSync === "" && hasThreatSyncEnabled === "" ) { 
        console.log("NULL");
    }
    else if (hasThreatSync === "true" && hasThreatSyncEnabled === "false" ){ 
        console.log("Has ThreatSync but Not Enabled");
        pendo.onGuideDismissed(); 
        pendo.showGuideById('b27syqXlPFK32xQkSssYXyqBXFM');
 
    }
    else{ 
        console.log ("How did I get here?");
        pendo.onGuideDismissed(); 
    }

First question, is there a difference between Guide Close and Guide Dismissed? If a guide is dismissed it enters in the cool off period for that visitor.  Is there an alternate way to exit the guide and NOT have it enter the cool off?

Second question, Is there a better way for me to trigger this Guide? Using a segment only references the static account object not the historical or dynamic data on load. 

0

Comments

1 comment
  • What about saving the guide container element as a variable, then updating any place you have pendo.onGuideDismissed() > set the guide's display to none? That way it's not truly dismissed, just hiding.

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post