Track Pendo guide events in Segment

Last updated:

Create or modify guide template

Below is an example of how you can track Pendo guide events in Segment.

Note: The following assumes you are using standard classes for your dismiss and advance elements.
analytics.track('guideSeen', { guideId: guide.id, stepId: step.id });

(function wireGuideAdvanceButton (step) {
    step && step.attachEvent(step.guideElement[0], 'click', function (e) {
        var advanceButton = pendo.dom(e.target || e.srcElement).closest('._pendo-guide-next_');
        if (advanceButton.length) {
            analytics.track('guideAdvanced', { guideId: guide.id, stepId: step.id });
            console.log('hello');
        }
        var dismissButton = pendo.dom(e.target || e.srcElement).closest('._pendo-close-guide_');
        if (dismissButton.length) {
            analytics.track('guideDismissed', { guideId: guide.id, stepId: step.id });
        }
    });
})(step,guide);
Was this article helpful?
0 out of 3 found this helpful