Skip to content

Commit

Permalink
feat: GROW-284 - bring back eventName
Browse files Browse the repository at this point in the history
  • Loading branch information
hba-fingerprint committed Nov 28, 2024
1 parent b6de144 commit 9a8ee0b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/client/thirdParty/Inkeep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { trackAskAIHelpMethodChosen } from './Amplitude';
import { useVisitorData } from '@fingerprintjs/fingerprintjs-pro-react';
import { FPJS_CLIENT_TIMEOUT } from '../../const';

const GET_HELP_OPTIONS_CLICKED = 'get_help_option_clicked';

/**
* Inkeep (AI Help) chat button
* Implemented according to https://docs.inkeep.com/integrations/nextjs/chat-button
Expand All @@ -37,11 +39,13 @@ const useInkeepSettings = (): InkeepSharedSettings => {
const visitorId = data?.visitorId || '';

const logEventCallback = (event: any) => {
const { name } = event.properties;
const pagePath = document.location.pathname;
const pageTitle = document.title;
if (event.eventName === GET_HELP_OPTIONS_CLICKED) {
const { name } = event.properties;
const pagePath = document.location.pathname;
const pageTitle = document.title;

trackAskAIHelpMethodChosen(name, visitorId, pagePath, pageTitle);
trackAskAIHelpMethodChosen(name, visitorId, pagePath, pageTitle);
}
};

const baseSettings: InkeepBaseSettings = {
Expand Down

0 comments on commit 9a8ee0b

Please sign in to comment.