diff --git a/projects/packages/forms/changelog/update-forms-tracking-plugin-installs b/projects/packages/forms/changelog/update-forms-tracking-plugin-installs new file mode 100644 index 0000000000000..ff5eb99a4d594 --- /dev/null +++ b/projects/packages/forms/changelog/update-forms-tracking-plugin-installs @@ -0,0 +1,4 @@ +Significance: minor +Type: changed + +Forms: Added tracking for plugin installations. diff --git a/projects/packages/forms/src/blocks/contact-form/components/jetpack-crm-integration/jetpack-crm-integration-settings-plugin-state.js b/projects/packages/forms/src/blocks/contact-form/components/jetpack-crm-integration/jetpack-crm-integration-settings-plugin-state.js index f12a4cf58c657..55681d8381aa5 100644 --- a/projects/packages/forms/src/blocks/contact-form/components/jetpack-crm-integration/jetpack-crm-integration-settings-plugin-state.js +++ b/projects/packages/forms/src/blocks/contact-form/components/jetpack-crm-integration/jetpack-crm-integration-settings-plugin-state.js @@ -1,3 +1,4 @@ +import { useAnalytics } from '@automattic/jetpack-shared-extension-utils'; import { Button, Icon, ToggleControl } from '@wordpress/components'; import { useState } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; @@ -50,8 +51,15 @@ const CRMPluginIsInstalling = ( { isActivating } ) => { }; const CRMPluginIsNotInstalled = ( { installAndActivateCRMPlugin, isInstalling } ) => { + const { tracks } = useAnalytics(); let button = ( - ); @@ -75,18 +83,25 @@ const CRMPluginIsNotInstalled = ( { installAndActivateCRMPlugin, isInstalling } }; const CRMPluginIsInstalled = ( { activateCRMPlugin, isInstalling } ) => { + const { tracks } = useAnalytics(); return (

{ __( - 'You already have the Jetpack CRM plugin installed, but it’s not activated.', + "You already have the Jetpack CRM plugin installed, but it's not activated.", 'jetpack-forms' ) }
{ isInstalling && } { ! isInstalling && ( - ) } diff --git a/projects/packages/forms/src/blocks/contact-form/components/jetpack-newsletter-integration-settings-plugin-state.js b/projects/packages/forms/src/blocks/contact-form/components/jetpack-newsletter-integration-settings-plugin-state.js index 3608157a7607e..9d21cdfbf254e 100644 --- a/projects/packages/forms/src/blocks/contact-form/components/jetpack-newsletter-integration-settings-plugin-state.js +++ b/projects/packages/forms/src/blocks/contact-form/components/jetpack-newsletter-integration-settings-plugin-state.js @@ -1,4 +1,4 @@ -import { getJetpackData } from '@automattic/jetpack-shared-extension-utils'; +import { getJetpackData, useAnalytics } from '@automattic/jetpack-shared-extension-utils'; import { Button, ExternalLink, Icon } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import { get } from 'lodash'; @@ -33,6 +33,7 @@ const CreativeMailPluginIsNotInstalled = ( { installAndActivateCreativeMailPlugin, isInstalling, } ) => { + const { tracks } = useAnalytics(); return (

@@ -43,7 +44,13 @@ const CreativeMailPluginIsNotInstalled = ( {
{ isInstalling && } { ! isInstalling && ( - ) } @@ -53,6 +60,7 @@ const CreativeMailPluginIsNotInstalled = ( { }; const CreativeMailPluginIsInstalled = ( { activateCreativeMailPlugin, isInstalling } ) => { + const { tracks } = useAnalytics(); return (

@@ -64,7 +72,13 @@ const CreativeMailPluginIsInstalled = ( { activateCreativeMailPlugin, isInstalli
{ isInstalling && } { ! isInstalling && ( - ) } @@ -81,7 +95,7 @@ const CreativeMailPluginIsActive = () => { return (

- { __( 'You’re all setup for email marketing with Creative Mail.', 'jetpack-forms' ) } + { __( "You're all setup for email marketing with Creative Mail.", 'jetpack-forms' ) }
{ __( 'Open Creative Mail settings', 'jetpack-forms' ) }