Web Engage GTM Event Listener
Track Web Engage notification, survey, and web push interactions in GTM. Capture webEngageAction, webEngageType (survey/notification/web push/feedback) across 15+ events.
web-engagenotificationssurveysweb-pushgtmga4engagementretention
Event fired
webengage_eventKey variable
webEngageActionWeb Engage
Overview
Web Engage is a comprehensive marketing automation and engagement platform with push notifications, in-page notifications, surveys, and feedback widgets. This listener tracks 15+ events across all Web Engage features.
Event fired: webengage_event
Variables: webEngageAction, webEngageType, notificationID, surveyID, webEngageEventData
webEngageType Values
| webEngageType | Description |
|---|---|
notification | In-page notification |
survey | Survey widget |
web push | Browser push notification |
feedback | Feedback widget (deprecated) |
Tracked Events (webEngageAction Values)
| webEngageAction | Description |
|---|---|
notification shown | In-page notification displayed |
notification opened | Notification clicked/expanded |
notification closed | Notification dismissed |
notification clicked | CTA in notification clicked |
survey opened | Survey widget opens |
survey closed | Survey dismissed |
survey answered | Survey question answered |
survey completed | Survey finished |
web push permission requested | Push permission prompt shown |
web push subscribed | User grants push permission |
web push blocked | User denies push permission |
web push notification shown | Push notification delivered |
web push notification clicked | Push notification clicked |
web push notification closed | Push notification dismissed |
Installation
html
<!-- GTM Custom HTML Tag: Web Engage Listener -->
<script>
(function() {
var weEvents = [
// Notifications
['webengage.notification.shown', 'notification shown', 'notification'],
['webengage.notification.opened', 'notification opened', 'notification'],
['webengage.notification.close', 'notification closed', 'notification'],
['webengage.notification.click', 'notification clicked', 'notification'],
// Surveys
['webengage.survey.shown', 'survey opened', 'survey'],
['webengage.survey.close', 'survey closed', 'survey'],
['webengage.survey.submit', 'survey answered', 'survey'],
['webengage.survey.complete', 'survey completed', 'survey'],
// Web Push
['webengage.webpush.permission_request', 'web push permission requested', 'web push'],
['webengage.webpush.subscribe', 'web push subscribed', 'web push'],
['webengage.webpush.deny', 'web push blocked', 'web push'],
['webengage.webpush.notification.shown', 'web push notification shown', 'web push'],
['webengage.webpush.notification.click', 'web push notification clicked', 'web push'],
['webengage.webpush.notification.close', 'web push notification closed', 'web push']
];
weEvents.forEach(function(def) {
document.addEventListener(def[0], function(e) {
var detail = e && e.detail;
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'webengage_event',
'webEngageAction': def[1],
'webEngageType': def[2],
'notificationID': detail && detail.notificationId,
'surveyID': detail && detail.surveyId,
'webEngageEventData': detail
});
});
});
})();
</script>Data Layer Output
Survey Completed
json
{
"event": "webengage_event",
"webEngageAction": "survey completed",
"webEngageType": "survey",
"surveyID": "survey_123",
"webEngageEventData": { "answers": [{ "question": "NPS", "answer": "9" }] }
}Web Push Subscribed
json
{
"event": "webengage_event",
"webEngageAction": "web push subscribed",
"webEngageType": "web push"
}Trigger Configuration
All Events
Trigger: Custom Event | webengage_event
Per Type
Condition: DLV – WE Type | equals | survey
Conversions
Condition: DLV – WE Action | matches RegEx | (survey completed|web push subscribed)
Variables to Capture
| Variable Name | DL Key | Example |
|---|---|---|
| DLV – WE Action | webEngageAction | "survey completed" |
| DLV – WE Type | webEngageType | "survey" |
| DLV – WE Survey ID | surveyID | "survey_123" |
| DLV – WE Notification ID | notificationID | "notif_456" |
GA4 Mapping
| GA4 Event | Condition | Parameters |
|---|---|---|
view_promotion | notification shown | notification_id, type |
select_promotion | notification clicked | notification_id |
survey_complete | survey completed | survey_id |
push_subscribe | web push subscribed | method: "webengage" |