Skip to content

Commit

Permalink
feat: trigger hotjar event on chat close (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
alangsto authored Aug 22, 2023
1 parent fd133ad commit 13df3f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Sidebar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ const Sidebar = ({

const handleClick = () => {
setIsOpen(false);

// check to see if hotjar is available, then trigger hotjar event
const hasWindow = typeof window !== 'undefined';
if (hasWindow && window.hj) {
window.hj('event', 'ocm_learning_assistant_chat_closed');
}
};

const handleUpdateCurrentMessage = (event) => {
Expand Down

0 comments on commit 13df3f2

Please sign in to comment.