Navigation: Adding Tracks by tying into wc-admin page view (https://github.com/woocommerce/woocommerce-admin/pull/5466)
* Adding 'has_navigation' flag to tracks pageView events to indicate if new navigation is enabled (https://github.com/woocommerce/woocommerce-admin/pull/5332) * Testing if navigation is active using window.wcNavigation instead of window.wcAdminFeatures to handle the edge case of a single page opting out
This commit is contained in:
parent
eefe2e8acc
commit
3c62e171da
|
@ -78,9 +78,16 @@ class _Layout extends Component {
|
||||||
isJetpackConnected,
|
isJetpackConnected,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
|
const navigationFlag = {
|
||||||
|
has_navigation: !! window.wcNavigation,
|
||||||
|
};
|
||||||
|
|
||||||
if ( isEmbedded ) {
|
if ( isEmbedded ) {
|
||||||
const path = document.location.pathname + document.location.search;
|
const path = document.location.pathname + document.location.search;
|
||||||
recordPageView( path, { is_embedded: true } );
|
recordPageView( path, {
|
||||||
|
is_embedded: true,
|
||||||
|
...navigationFlag,
|
||||||
|
} );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,6 +108,7 @@ class _Layout extends Component {
|
||||||
jetpack_installed: installedPlugins.includes( 'jetpack' ),
|
jetpack_installed: installedPlugins.includes( 'jetpack' ),
|
||||||
jetpack_active: activePlugins.includes( 'jetpack' ),
|
jetpack_active: activePlugins.includes( 'jetpack' ),
|
||||||
jetpack_connected: isJetpackConnected,
|
jetpack_connected: isJetpackConnected,
|
||||||
|
...navigationFlag,
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue