From 9c88213435b9d3e7c377049a50aa457d67615e5d Mon Sep 17 00:00:00 2001 From: bblaisATcoveo Date: Wed, 3 Jun 2026 10:30:43 -0400 Subject: [PATCH] add trigger custom click event --- src/connector.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/connector.js b/src/connector.js index a5b81df..58e0344 100644 --- a/src/connector.js +++ b/src/connector.js @@ -13,6 +13,7 @@ import { buildNotifyTrigger, loadAdvancedSearchQueryActions, loadSortCriteriaActions, + loadGenericAnalyticsActions, HighlightUtils } from './headless.esm.js'; @@ -1314,6 +1315,18 @@ function updateNotifyTriggerState ( newState ) { if ( notificationState.notifications?.length ) { notificationTriggerElement.innerHTML = notificationTriggerTemplateHTML.replace( "%[notification]", DOMPurify.sanitize( notificationState.notifications[0] ) ); + notificationTriggerElement.onclick = ( elemClicked ) => { + if ( elemClicked.target.tagName.toLowerCase() === 'a' ) { + const { logCustomEvent } = loadGenericAnalyticsActions( headlessEngine ); + const payload = { + type: 'queryPipelineNotificationTrigger', + meta: { 'triggerLinkUrl': elemClicked.target?.href }, + evt: 'click' + }; + + headlessEngine.dispatch( logCustomEvent( payload ) ); + } + }; focusToView(); } else {