From 26d2d9e43e05ecad1ef6d6ba5b8e2d61e50d5371 Mon Sep 17 00:00:00 2001 From: Vaidehi Joshi Date: Wed, 24 Jun 2020 13:02:37 -0700 Subject: [PATCH] Track an event's target when clicking on a welcome notification (#8894) [deploy] --- app/views/notifications/index.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/notifications/index.html.erb b/app/views/notifications/index.html.erb index d38ae45c2..a2fb11a37 100644 --- a/app/views/notifications/index.html.erb +++ b/app/views/notifications/index.html.erb @@ -26,12 +26,16 @@ * @param {Event} The click event on the notification. */ function trackNotification(event) { - const { parentElement: { id: title }, text } = event.target; + const target = event.target; + const { parentElement: { id: title }, text } = target; + + // TODO: [@thepracticaldev/delightful]: This event doesn't appear to be firing on Honeybadger. + // We probably want to remove it eventually if we continually don't see it being triggered. if (!title) { Honeybadger.notify(`Could not find parentElement.id when clicking on event target text: ${text}`); } - ahoy.track("Clicked Welcome Notification", { title, text }); + ahoy.track("Clicked Welcome Notification", { title, text, target: target.toString() }); }