CYS: Fix Looker dashboard data (#51206)
* Track data for font and color pairings including 'Create your own' option in CYS * Add changelog file * Track data for logo flow * Send the open param as part of the tracking event customize_your_store_assembler_hub_color_palette_create_toggle
This commit is contained in:
parent
a06c6ba496
commit
f39e1d72c0
|
@ -14,6 +14,11 @@ import { mergeBaseAndUserConfigs } from '@wordpress/edit-site/build-module/compo
|
||||||
import { unlock } from '@wordpress/edit-site/build-module/lock-unlock';
|
import { unlock } from '@wordpress/edit-site/build-module/lock-unlock';
|
||||||
import { isEqual, noop } from 'lodash';
|
import { isEqual, noop } from 'lodash';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
import { trackEvent } from '~/customize-store/tracking';
|
||||||
|
|
||||||
const { GlobalStylesContext } = unlock( blockEditorPrivateApis );
|
const { GlobalStylesContext } = unlock( blockEditorPrivateApis );
|
||||||
|
|
||||||
// Removes the typography settings from the styles when the user is changing
|
// Removes the typography settings from the styles when the user is changing
|
||||||
|
@ -100,6 +105,24 @@ export const VariationContainer = ( { variation, children } ) => {
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
if ( variation.settings.color?.palette ) {
|
||||||
|
trackEvent(
|
||||||
|
'customize_your_store_assembler_hub_color_palette_item_click',
|
||||||
|
{
|
||||||
|
item: variation.title,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( variation.settings.typography ) {
|
||||||
|
trackEvent(
|
||||||
|
'customize_your_store_assembler_hub_typography_item_click',
|
||||||
|
{
|
||||||
|
item: variation.title,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectOnEnter = ( event ) => {
|
const selectOnEnter = ( event ) => {
|
||||||
|
|
|
@ -17,6 +17,7 @@ import { unlock } from '@wordpress/edit-site/build-module/lock-unlock';
|
||||||
import { CustomizeStoreContext } from '../';
|
import { CustomizeStoreContext } from '../';
|
||||||
import { SidebarNavigationScreen } from './sidebar-navigation-screen';
|
import { SidebarNavigationScreen } from './sidebar-navigation-screen';
|
||||||
import { ColorPalette, ColorPanel } from './global-styles';
|
import { ColorPalette, ColorPanel } from './global-styles';
|
||||||
|
import { trackEvent } from '~/customize-store/tracking';
|
||||||
import { FlowType } from '~/customize-store/types';
|
import { FlowType } from '~/customize-store/types';
|
||||||
|
|
||||||
const { GlobalStylesContext } = unlock( blockEditorPrivateApis );
|
const { GlobalStylesContext } = unlock( blockEditorPrivateApis );
|
||||||
|
@ -27,6 +28,14 @@ const SidebarNavigationScreenColorPaletteContent = () => {
|
||||||
const hasCreatedOwnColors = !! (
|
const hasCreatedOwnColors = !! (
|
||||||
user.settings.color && user.settings.color.palette.hasCreatedOwnColors
|
user.settings.color && user.settings.color.palette.hasCreatedOwnColors
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function handlePanelBodyToggle( open?: boolean ) {
|
||||||
|
trackEvent(
|
||||||
|
'customize_your_store_assembler_hub_color_palette_create_toggle',
|
||||||
|
{ open }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are
|
// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are
|
||||||
// loaded. This is necessary because the Iframe component waits until
|
// loaded. This is necessary because the Iframe component waits until
|
||||||
// the block editor store's `__internalIsInitialized` is true before
|
// the block editor store's `__internalIsInitialized` is true before
|
||||||
|
@ -45,6 +54,7 @@ const SidebarNavigationScreenColorPaletteContent = () => {
|
||||||
className="woocommerce-customize-store__color-panel-container"
|
className="woocommerce-customize-store__color-panel-container"
|
||||||
title={ __( 'or create your own', 'woocommerce' ) }
|
title={ __( 'or create your own', 'woocommerce' ) }
|
||||||
initialOpen={ hasCreatedOwnColors }
|
initialOpen={ hasCreatedOwnColors }
|
||||||
|
onToggle={ handlePanelBodyToggle }
|
||||||
>
|
>
|
||||||
<ColorPanel />
|
<ColorPanel />
|
||||||
</PanelBody>
|
</PanelBody>
|
||||||
|
|
|
@ -297,16 +297,26 @@ const LogoEdit = ( {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleMediaUploadSelect( media: { id: string; url: string } ) {
|
||||||
|
onInitialSelectLogo( media );
|
||||||
|
trackEvent( 'customize_your_store_assembler_hub_logo_select' );
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! logoUrl ) {
|
if ( ! logoUrl ) {
|
||||||
return (
|
return (
|
||||||
<MediaUploadCheck>
|
<MediaUploadCheck>
|
||||||
<MediaUpload
|
<MediaUpload
|
||||||
onSelect={ onInitialSelectLogo }
|
onSelect={ handleMediaUploadSelect }
|
||||||
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
||||||
render={ ( { open }: { open: () => void } ) => (
|
render={ ( { open }: { open: () => void } ) => (
|
||||||
<Button
|
<Button
|
||||||
variant="link"
|
variant="link"
|
||||||
onClick={ open }
|
onClick={ () => {
|
||||||
|
open();
|
||||||
|
trackEvent(
|
||||||
|
'customize_your_store_assembler_hub_logo_add_click'
|
||||||
|
);
|
||||||
|
} }
|
||||||
className="block-library-site-logo__inspector-upload-container"
|
className="block-library-site-logo__inspector-upload-container"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
|
@ -351,10 +361,17 @@ const LogoEdit = ( {
|
||||||
<>
|
<>
|
||||||
<MediaUploadCheck>
|
<MediaUploadCheck>
|
||||||
<MediaUpload
|
<MediaUpload
|
||||||
onSelect={ onInitialSelectLogo }
|
onSelect={ handleMediaUploadSelect }
|
||||||
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
||||||
render={ ( { open }: { open: () => void } ) =>
|
render={ ( { open }: { open: () => void } ) =>
|
||||||
cloneElement( logoImg, { onClick: open } )
|
cloneElement( logoImg, {
|
||||||
|
onClick() {
|
||||||
|
open();
|
||||||
|
trackEvent(
|
||||||
|
'customize_your_store_assembler_hub_logo_edit_click'
|
||||||
|
);
|
||||||
|
},
|
||||||
|
} )
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</MediaUploadCheck>
|
</MediaUploadCheck>
|
||||||
|
@ -478,6 +495,9 @@ export const SidebarNavigationScreenLogo = ( {
|
||||||
media
|
media
|
||||||
);
|
);
|
||||||
onClose();
|
onClose();
|
||||||
|
trackEvent(
|
||||||
|
'customize_your_store_assembler_hub_logo_select'
|
||||||
|
);
|
||||||
} }
|
} }
|
||||||
allowedTypes={
|
allowedTypes={
|
||||||
ALLOWED_MEDIA_TYPES
|
ALLOWED_MEDIA_TYPES
|
||||||
|
@ -490,6 +510,9 @@ export const SidebarNavigationScreenLogo = ( {
|
||||||
<MenuItem
|
<MenuItem
|
||||||
onClick={ () => {
|
onClick={ () => {
|
||||||
open();
|
open();
|
||||||
|
trackEvent(
|
||||||
|
'customize_your_store_assembler_hub_logo_replace_click'
|
||||||
|
);
|
||||||
} }
|
} }
|
||||||
>
|
>
|
||||||
{ __(
|
{ __(
|
||||||
|
@ -508,6 +531,9 @@ export const SidebarNavigationScreenLogo = ( {
|
||||||
onClick={ () => {
|
onClick={ () => {
|
||||||
onClose();
|
onClose();
|
||||||
onRemoveLogo();
|
onRemoveLogo();
|
||||||
|
trackEvent(
|
||||||
|
'customize_your_store_assembler_hub_logo_remove_click'
|
||||||
|
);
|
||||||
} }
|
} }
|
||||||
>
|
>
|
||||||
{ __(
|
{ __(
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: add
|
||||||
|
|
||||||
|
Track data for font and color pairings including 'Create your own' option in CYS
|
Loading…
Reference in New Issue