Skip to content

Commit 40ce1c3

Browse files
authored
add events on jetpack form ai extension (#35257)
1 parent 6b222cd commit 40ce1c3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: other
3+
4+
AI Forms Extension: add events on ai actions

projects/plugins/jetpack/extensions/blocks/ai-assistant/extensions/jetpack-contact-form/components/ai-assistant-bar/index.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,26 @@ export default function AiAssistantBar( {
136136
dequeueAiAssistantFeatureAyncRequest();
137137

138138
requestSuggestion( prompt, { feature: 'jetpack-form-ai-extension' } );
139+
tracks.recordEvent( 'jetpack_ai_assistant_block_generate', {
140+
feature: 'jetpack-form-ai-extension',
141+
} );
139142
wrapperRef?.current?.focus();
140143
}, [
141144
clientId,
142145
dequeueAiAssistantFeatureAyncRequest,
143146
inputValue,
144147
removeNotice,
145148
requestSuggestion,
149+
tracks,
146150
] );
147151

148152
const handleStopSuggestion = useCallback( () => {
149153
stopSuggestion();
150154
focusOnPrompt();
151-
}, [ stopSuggestion ] );
155+
tracks.recordEvent( 'jetpack_ai_assistant_block_stop', {
156+
feature: 'jetpack-form-ai-extension',
157+
} );
158+
}, [ stopSuggestion, tracks ] );
152159

153160
/*
154161
* Fix the assistant bar when the viewport is mobile,

0 commit comments

Comments
 (0)