Add Onboarding Heuristics Tracks Event (#37767)

* Add heuristics data to onboarding setting

* Add track

* Add Tracks event
This commit is contained in:
Adrian Duffell 2023-04-18 04:47:24 +08:00 committed by GitHub
parent f6685b88b9
commit 4fca6d1f63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View File

@ -96,6 +96,14 @@ class Industry extends Component {
return this.state.selected.map( ( industry ) => industry.slug );
}
componentDidMount() {
recordEvent( 'onboarding_site_heuristics', {
page_count: onboarding.pageCount,
post_count: onboarding.postCount,
is_block_theme: onboarding.isBlockTheme,
} );
}
componentDidUpdate() {
this.props.updateCurrentStepValues(
this.props.step.key,

View File

@ -0,0 +1,4 @@
Significance: minor
Type: dev
Add tracks event to gather onboarding heuristics

View File

@ -230,6 +230,9 @@ class OnboardingSetupWizard {
$settings['onboarding']['euCountries'] = WC()->countries->get_european_union_countries();
$settings['onboarding']['localeInfo'] = include WC()->plugin_path() . '/i18n/locale-info.php';
$settings['onboarding']['profile'] = $profile;
$settings['onboarding']['pageCount'] = (int) ( wp_count_posts( 'page' ) )->publish;
$settings['onboarding']['postCount'] = (int) ( wp_count_posts( 'post' ) )->publish;
$settings['onboarding']['isBlockTheme'] = wc_current_theme_is_fse_theme();
return apply_filters( 'woocommerce_admin_onboarding_preloaded_data', $settings );
}