From 1b0e81af20e7ac8e01ad67f5e20b275461240247 Mon Sep 17 00:00:00 2001 From: David Blankenship <128765777+dblanken-yale@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:17:43 -0400 Subject: [PATCH] Add class for #launch-chat links (#16) * feat(chatbot-classes): add class for #launch-chat links Since SiteImprove and other services will not work tracking anchor tags, we append a class to each link that is targeting the #launch-chat trigger so that it can better be tracked. --- modules/ai_engine_chat/js/events.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ai_engine_chat/js/events.js b/modules/ai_engine_chat/js/events.js index 1b5dd8a..0ed5e55 100644 --- a/modules/ai_engine_chat/js/events.js +++ b/modules/ai_engine_chat/js/events.js @@ -8,6 +8,7 @@ document.addEventListener("DOMContentLoaded", function () { var launchLinks = document.querySelectorAll('a[href="#launch-chat"]'); launchLinks.forEach(function (link) { + link.classList.add("ai-chatbot"); link.addEventListener("click", function (event) { event.preventDefault(); // Trigger a click on the button with id "launch-chat-modal".