diff --git a/projects/plugins/jetpack/changelog/add-ai-assistant-prompt-show-event b/projects/plugins/jetpack/changelog/add-ai-assistant-prompt-show-event new file mode 100644 index 0000000000000..5d57f9fa0feec --- /dev/null +++ b/projects/plugins/jetpack/changelog/add-ai-assistant-prompt-show-event @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +AI Assistant: add menu show events on both control and extension (form) diff --git a/projects/plugins/jetpack/composer.json b/projects/plugins/jetpack/composer.json index abdcf238a475d..983ef7e762889 100644 --- a/projects/plugins/jetpack/composer.json +++ b/projects/plugins/jetpack/composer.json @@ -101,7 +101,7 @@ "platform": { "ext-intl": "0.0.0" }, - "autoloader-suffix": "f11009ded9fc4592b6a05b61ce272b3c_jetpackā“„13_1_a_7", + "autoloader-suffix": "f11009ded9fc4592b6a05b61ce272b3c_jetpackā“„13_1_a_8", "allow-plugins": { "automattic/jetpack-autoloader": true, "automattic/jetpack-composer-plugin": true diff --git a/projects/plugins/jetpack/extensions/blocks/ai-assistant/components/ai-assistant-controls/index.tsx b/projects/plugins/jetpack/extensions/blocks/ai-assistant/components/ai-assistant-controls/index.tsx index 0081a5000d8ee..d835bc77769e0 100644 --- a/projects/plugins/jetpack/extensions/blocks/ai-assistant/components/ai-assistant-controls/index.tsx +++ b/projects/plugins/jetpack/extensions/blocks/ai-assistant/components/ai-assistant-controls/index.tsx @@ -217,6 +217,7 @@ function AiAssistantDropdownContent( { ); removeBlocks( otherBlocksIds ); + tracks.recordEvent( 'jetpack_ai_assistant_prompt_show', { block_type: blockType } ); }; return ( diff --git a/projects/plugins/jetpack/extensions/blocks/ai-assistant/extensions/jetpack-contact-form/components/ai-assistant-bar/index.tsx b/projects/plugins/jetpack/extensions/blocks/ai-assistant/extensions/jetpack-contact-form/components/ai-assistant-bar/index.tsx index dba81e07be496..b14c1d9c2b49b 100644 --- a/projects/plugins/jetpack/extensions/blocks/ai-assistant/extensions/jetpack-contact-form/components/ai-assistant-bar/index.tsx +++ b/projects/plugins/jetpack/extensions/blocks/ai-assistant/extensions/jetpack-contact-form/components/ai-assistant-bar/index.tsx @@ -2,6 +2,7 @@ * External dependencies */ import { useAiContext, AIControl, ERROR_QUOTA_EXCEEDED } from '@automattic/jetpack-ai-client'; +import { useAnalytics } from '@automattic/jetpack-shared-extension-utils'; import { serialize } from '@wordpress/blocks'; import { KeyboardShortcuts } from '@wordpress/components'; import { useViewportMatch } from '@wordpress/compose'; @@ -79,6 +80,7 @@ export default function AiAssistantBar( { } ) { const wrapperRef = useRef< HTMLDivElement >( null ); const inputRef = useRef< HTMLInputElement >( null ); + const { tracks } = useAnalytics(); const connected = isUserConnected(); @@ -201,6 +203,14 @@ export default function AiAssistantBar( { }; }, [ isAssistantBarFixed, isVisible ] ); + useEffect( () => { + if ( isVisible ) { + tracks.recordEvent( 'jetpack_ai_assistant_prompt_show', { + block_type: 'jetpack/contact-form', + } ); + } + }, [ isVisible, tracks ] ); + // focus input on first render only (for a11y reasons, toggling on/off should not focus the input) useEffect( () => { /* diff --git a/projects/plugins/jetpack/extensions/blocks/ai-assistant/extensions/jetpack-contact-form/index.tsx b/projects/plugins/jetpack/extensions/blocks/ai-assistant/extensions/jetpack-contact-form/index.tsx index 6fec78fc0e080..18f9ecdbec809 100644 --- a/projects/plugins/jetpack/extensions/blocks/ai-assistant/extensions/jetpack-contact-form/index.tsx +++ b/projects/plugins/jetpack/extensions/blocks/ai-assistant/extensions/jetpack-contact-form/index.tsx @@ -141,7 +141,7 @@ const jetpackFormEditWithAiComponents = createHigherOrderComponent( BlockEdit => * and close the event source. */ return () => { - // Only stop when the parent block is unmouted. + // Only stop when the parent block is unmounted. if ( props?.name !== 'jetpack/contact-form' ) { return; } diff --git a/projects/plugins/jetpack/jetpack.php b/projects/plugins/jetpack/jetpack.php index 9761395542086..6e1679763f495 100644 --- a/projects/plugins/jetpack/jetpack.php +++ b/projects/plugins/jetpack/jetpack.php @@ -4,7 +4,7 @@ * Plugin URI: https://jetpack.com * Description: Security, performance, and marketing tools made by WordPress experts. Jetpack keeps your site protected so you can focus on more important things. * Author: Automattic - * Version: 13.1-a.7 + * Version: 13.1-a.8 * Author URI: https://jetpack.com * License: GPL2+ * Text Domain: jetpack @@ -34,7 +34,7 @@ define( 'JETPACK__MINIMUM_WP_VERSION', '6.3' ); define( 'JETPACK__MINIMUM_PHP_VERSION', '7.0' ); -define( 'JETPACK__VERSION', '13.1-a.7' ); +define( 'JETPACK__VERSION', '13.1-a.8' ); /** * Constant used to fetch the connection owner token diff --git a/projects/plugins/jetpack/package.json b/projects/plugins/jetpack/package.json index 5325437124720..06f349b7abbd1 100644 --- a/projects/plugins/jetpack/package.json +++ b/projects/plugins/jetpack/package.json @@ -1,6 +1,6 @@ { "name": "Jetpack", - "version": "13.1.0-a.7", + "version": "13.1.0-a.8", "private": true, "description": "[Jetpack](https://jetpack.com/) is a WordPress plugin that supercharges your self-hosted WordPress site with the awesome cloud power of [WordPress.com](https://wordpress.com).", "homepage": "https://jetpack.com",