Skip to content

Commit

Permalink
feat: GROW-284 - PR Remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
hba-fingerprint committed Nov 27, 2024
1 parent 202fe87 commit 5488cd0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
7 changes: 1 addition & 6 deletions src/client/thirdParty/Amplitude.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ type AmplitudeProps = {
apiKey: string;
};

export function trackAskAIHelpMethodChosen(
helpMethod: string,
visitorId: string,
pagePath: string,
pageTitle: string,
) {
export function trackAskAIHelpMethodChosen(helpMethod: string, visitorId: string, pagePath: string, pageTitle: string) {
amplitude.track(ASK_AI_CHOSEN_EVENT_TYPE, {
helpMethod,
visitorId,
Expand Down
8 changes: 2 additions & 6 deletions src/client/thirdParty/Inkeep.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use client';

import { InkeepChatButtonProps } from '@inkeep/uikit';
import type {
InkeepAIChatSettings,
InkeepSearchSettings,
Expand All @@ -13,8 +12,6 @@ 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 @@ -39,15 +36,14 @@ const useInkeepSettings = (): InkeepSharedSettings => {
const { data } = useVisitorData({ extendedResult: true, timeout: FPJS_CLIENT_TIMEOUT });
const visitorId = data?.visitorId || '';


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

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

const baseSettings: InkeepBaseSettings = {
apiKey,
Expand Down

0 comments on commit 5488cd0

Please sign in to comment.