Track an event's target when clicking on a welcome notification (#8894) [deploy]

This commit is contained in:
Vaidehi Joshi 2020-06-24 13:02:37 -07:00 committed by GitHub
parent 9fb2a7c6b2
commit 26d2d9e43e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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() });
}
</script>