Skip to content

Commit

Permalink
Add class for #launch-chat links (#16)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
dblanken-yale authored Oct 25, 2024
1 parent ef390e8 commit 1b0e81a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions modules/ai_engine_chat/js/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down

0 comments on commit 1b0e81a

Please sign in to comment.