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_eventsKey variable
userpilot_actionUserpilot
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_action | Description |
|---|---|
experience started | Flow/tour begins |
experience step completed | User completes a step |
experience completed | Full flow completed |
experience dismissed | User skips/dismisses |
checklist item completed | Task completed |
checklist completed | All tasks done |
nps shown | NPS survey displayed |
nps submitted | NPS score submitted |
survey submitted | Custom survey completed |
resource center opened | Help center opened |
resource article viewed | Article 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
| Trigger | Condition |
|---|---|
| CE – UP NPS | userpilot_action = nps submitted |
| CE – UP Experience Done | userpilot_action = experience completed |
| CE – UP All | none |
GA4 Mapping
| GA4 Event | Condition | Parameters |
|---|---|---|
tutorial_complete | experience completed | experience_id |
nps_survey | nps submitted | nps_score, nps_comment |