Tech Note: Programmatically launch and dismiss the Resource Center

If you have a scenario where you want to automatically launch and/or dismiss the Resource Center, it is possible to do this programmatically, using the Pendo Agent API. 

Launch the Resource Center:

window.pendo.BuildingBlocks.BuildingBlockResourceCenter.getResourceCenter().show()

Dismiss the Resource Center:


window.pendo.BuildingBlocks.BuildingBlockResourceCenter.dismissResourceCenter()

 

Please note this would require dev resources on your side to implement. Additionally, the visitor still needs to be eligible/be in the segment for Resource Center modules and the content within the modules.

---------------

 

Please note: This custom code snippet is intended to extend the capabilities of Pendo products. This snippet is free to use, and as such, there is NO WARRANTY, SLA or SUPPORT for these snippets. Please do not reach out to Pendo Support for help with these snippets, as custom code is outside of the remit of their team and responsibilities.  Any requests to create new snippets, or modify / customize functionality within existing snippets should be forwarded to Pendo Professional Services () for scoping. These will require a custom services contract in order to complete.

4

Comments

11 comments
  • This is great, but what if i would like to show a particular RC Module on a specific page only and keep it hidden on all other pages ?

    0
  • Rohit Pandey

    If it's a guide list or onboarding module, you would need to control this at the individual guide level using the page location set for the first step of each guide. If the current URL the user is on does not match the page location for any of the guides in the guide list module, the guide list module will not appear. 

    For any other module, you would have to control this at the module level, specifically via the segment, and it would require some configuration changes by your developers. 

    • When the user goes to a page where the module should not appear, a new visitor metadata field would be set. Something like "module_hidden: true"
    • When the user goes to other pages where the module can appear, the metadata field would be updated to "module_hidden: false"
    • The  module segment would include a rule like "module_hidden = false". 
    • As the user switches between pages where they should see and shouldn't see the module, the metadata will change, and they'll either be eligible to see the module or not. 

    I would also recommend submitting a feature request for the ability to set page location for non-guide related Resource center modules.  

    0
  • Angela-Holly is there also an API for the count of new (unread) items that displays in the badge that invokes the resource center?

     

    0
  • Sanjay are you asking how to modify the appearance of or hide the 'unread' bubble? 

    Or are you asking if the numeric value of the 'unread' bubble can be modified? 

    0
  • I'm getting an error using this script:

    pendo.js:10 Uncaught TypeError: Cannot read properties of undefined (reading 'steps') at Object.q [as dismissResourceCenter] (pendo.js:10:219209) at HTMLAnchorElement.onclick ((index):1:61)
      q @ pendo.js:10
      onclick @ (index):1

    Is this script still valid, or is there an updated version I should use?

    0
  • Pete Lawrence, this still works for me. If you still need help, I'd recommend having our Support team take a closer look: https://support.pendo.io/hc/en-us/articles/360034163971-Get-help-with-Pendo-from-Technical-Support

    0
  • Pete Lawrence another option you can try is:

    0
  • Angela-Holly follow up on Sanjay's question.  We too would like to get the count of unread items in the research center.   The use case is we need to put the resource center active in our app's nav as the floating bubble is getting into the way of features.   It's clear how to accomplish this but we'd like to be able to continue to show the unread messages to so the question is how can we query for that so we can display that number ourselves?

    0
  • Josh Todd Van Lente, there is no API endpoint/ agent function that will provide you with the unread announcement value. If this would be helpful, please submit a feature request. 

    I'm also wondering why this is necessary? You mentioned needing to switch from badge activation to target element activation for the Resource Center. When using target element activation for the Resource Center, you can still use Pendo's default unread announcement bubble functionality. 

    0
  • Hi Angela!  I didn't realize the count would show if we used target element!   This is a pretty good solution but not perfect.   We use a similar pattern when there are unread items in various parts of our app and the pendo bubble is slightly different size.  Additionally, it looks like the only option is the have it on the right of the element where we have ours on the left...might try having dev put an invisible element to the right of the desired element to accomplish this unless you have another solution?

    To answer your question directly, I was trying to match the style of our app

    0
  • Hi Angela-Holly!  So we are trying to use your suggested approach of target element activation which we made work for showing the alert count.   However we have another use case where we need to activate programmatically, when I set the activation method to target element it seems to disable API activation.   Is that true, and if so, is there a work around to use both?

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post