Skip to main content

Userpilot GTM Event Listener

Track Userpilot in-app experience interactions in GTM. Monitor flow steps, checklist completions, survey responses, and resource center usage with userpilot_action variable.

userpilotuser-onboardingin-appgtmga4saasproduct-analytics

Event fired

userpilot_events

Key variable

userpilot_action

Userpilot

Overview

Userpilot is a product adoption and user onboarding platform for SaaS apps. It helps product teams build in-app experiences, feature tours, surveys, and NPS. This listener tracks all Userpilot experience interactions.

Event fired: userpilot_events Variable: userpilot_action

Tracked Events

userpilot_actionDescription
experience startedFlow/tour begins
experience step completedUser completes a step
experience completedFull flow completed
experience dismissedUser skips/dismisses
checklist item completedTask completed
checklist completedAll tasks done
nps shownNPS survey displayed
nps submittedNPS score submitted
survey submittedCustom survey completed
resource center openedHelp center opened
resource article viewedArticle read

Installation

html
<!-- GTM Custom HTML Tag: Userpilot Listener -->
<script>
(function() {
  function upPush(action, extra) {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push(Object.assign({
      'event': 'userpilot_events',
      'userpilot_action': action
    }, extra || {}));
  }

  var initUP = function() {
    if (typeof window.userpilot === 'undefined') return;
    
    userpilot.on('experienceStarted', function(d) {
      upPush('experience started', { experienceId: d.experienceId, experienceName: d.name });
    });
    userpilot.on('stepCompleted', function(d) {
      upPush('experience step completed', { step: d.stepIndex, total: d.totalSteps });
    });
    userpilot.on('experienceCompleted', function(d) {
      upPush('experience completed', { experienceId: d.experienceId });
    });
    userpilot.on('experienceDismissed', function(d) {
      upPush('experience dismissed', { experienceId: d.experienceId });
    });
    userpilot.on('npsShown', function() { upPush('nps shown'); });
    userpilot.on('npsSubmitted', function(d) {
      upPush('nps submitted', { npsScore: d.score, npsComment: d.comment });
    });
    userpilot.on('surveySubmitted', function(d) {
      upPush('survey submitted', { surveyId: d.surveyId });
    });
  };

  window.addEventListener('load', initUP);
})();
</script>

Data Layer Output

NPS Submitted

json
{
  "event": "userpilot_events",
  "userpilot_action": "nps submitted",
  "npsScore": 9,
  "npsComment": "Love the new dashboard!"
}

Experience Completed

json
{
  "event": "userpilot_events",
  "userpilot_action": "experience completed",
  "experienceId": "exp_onboarding_flow"
}

Triggers to Create

TriggerCondition
CE – UP NPSuserpilot_action = nps submitted
CE – UP Experience Doneuserpilot_action = experience completed
CE – UP Allnone

GA4 Mapping

GA4 EventConditionParameters
tutorial_completeexperience completedexperience_id
nps_surveynps submittednps_score, nps_comment

Related Listeners