How can I get Pendo to work in my Guide/Community?
Hey all -
We use Pendo for our SaaS application to drive messaging around new release announcements, functionality additions/changes, as well as walk throughs on new functions to help get users familiarized. This got us wanting to integrate Pendo into our Guide pages/Community pages so that visitors there could continue to get these highlights and insight and we could target our audiences in a more meaningful way. After running into some brick walls on setup, we were able to work through it and found the following:
When using the code snippet from Pendo, you will need to get the UserID from Zendesk Support for each user that you wish to have visibility of the Pendo widget. This is done by creating a Customer List in Zendesk Support and ensuring the User ID column is displayed.
After you have the User ID, you can place it in the id section of the Pendo snippet, with separating commas for each ID.
pendo.initialize({
visitor: {
id: '461337005,234567,6789012' // Required if user is logged in //
email: // Optional //
role: // Optional //
You can add any additional visitor level key-values here, // as long as it's not one of the above reserved names. }
Save this script snippet on the desired page(s) you wish for it to be visible - either at the top of each page you are choosing to display it, or your at the bottom of your document_head.hbs file if you want it visible on all pages.
When those identified users go to your Help Center and are logged, they will be able to see the Pendo widget on their end.
If you do not wish to segment visibility to specific users/groups, in Pendo, you can check the box to Show Guides to Anonymous Visitors, which will make the guide visible to anyone whether logged in or not.
-
There may be a way to tie in some JS to pull in the user's UserID value from the API or otherwise, and have it populated once logged in, but that is a bit beyond my skillset at the moment. If anyone has prior success or experience in doing this and wants to share a snippet or example of how they got it to pull in the UserID after a user logs in, that would be awesome.
-
Found the best way to pass in the User ID from Zendesk to the Pendo snippet using some source code reading and regex-fu. You'll see in the snippet below, we are reading the HTML and looking for a specific link in the source code for signed in users. If users are NOT signed in, then the Pendo widget will be hidden from them.
var code = document.getElementsByTagName("link")[3];
var string = code.outerHTML;
var index = string.indexOf("user_id");
var lastIndex = string.lastIndexOf("\"");
var id = string.slice(index+8, lastIndex);
Once we run through these variables and get the desired format, we pass the last variable, id, into the Pendo snippet where it asks for the visitor's id value, as shown below.
pendo.initialize({
visitor: {
id: id // Required if user is logged in, testing Robben, Sheldon, Jonny, my test user, and my admin acct
// email: // Optional
// role: // Optional// You can add any additional visitor level key-values here,
// as long as its not one of the above reserved names.
} -
This is awesome. Thanks for sharing Jeremy!
I'll get this added to our monthly roundup so others can take a look at this as well :)
-
Thanks Brett! I hope others find it useful as well to mesh the two together.
Please sign in to leave a comment.
4 Comments