diff --git a/assets/js/components/setup/ModuleSetup.test.js b/assets/js/components/setup/ModuleSetup.test.js index 71470ff5985..297253ec3eb 100644 --- a/assets/js/components/setup/ModuleSetup.test.js +++ b/assets/js/components/setup/ModuleSetup.test.js @@ -91,9 +91,7 @@ describe( 'ModuleSetup', () => { const propertyID = properties[ 0 ]._id; const webDataStreamID = webDataStreamsBatch[ propertyID ][ 0 ]._id; - registry.dispatch( MODULES_ANALYTICS_4 ).receiveGetSettings( { - adsConversionID: '', - } ); + registry.dispatch( MODULES_ANALYTICS_4 ).receiveGetSettings( {} ); registry .dispatch( MODULES_ANALYTICS_4 ) diff --git a/assets/js/modules/analytics-4/components/settings/OptionalSettingsView.js b/assets/js/modules/analytics-4/components/settings/OptionalSettingsView.js index 7ed0b2dcb59..574b4c2d50b 100644 --- a/assets/js/modules/analytics-4/components/settings/OptionalSettingsView.js +++ b/assets/js/modules/analytics-4/components/settings/OptionalSettingsView.js @@ -20,91 +20,48 @@ * WordPress dependencies */ import { __, _x } from '@wordpress/i18n'; -import { Fragment } from '@wordpress/element'; /** * Internal dependencies */ import { useSelect } from 'googlesitekit-data'; import { MODULES_ANALYTICS_4 } from '@/js/modules/analytics-4/datastore/constants'; -import DisplaySetting from '@/js/components/DisplaySetting'; import { trackingExclusionLabels } from '@/js/modules/analytics-4/components/common/TrackingExclusionSwitches'; import Typography from '@/js/components/Typography'; export default function OptionalSettingsView() { - const useSnippet = useSelect( ( select ) => - select( MODULES_ANALYTICS_4 ).getUseSnippet() - ); - const adsConversionIDMigratedAtMs = useSelect( ( select ) => - select( MODULES_ANALYTICS_4 ).getAdsConversionIDMigratedAtMs() - ); const trackingDisabled = useSelect( ( select ) => select( MODULES_ANALYTICS_4 ).getTrackingDisabled() || [] ); - const adsConversionID = useSelect( ( select ) => - select( MODULES_ANALYTICS_4 ).getAdsConversionID() - ); return ( - -
-
- - { __( 'Excluded from Analytics', 'google-site-kit' ) } - -

- { !! trackingDisabled.length && - trackingDisabled - .map( - ( exclusion ) => - trackingExclusionLabels[ exclusion ] - ) - .join( - _x( - ', ', - 'list separator', - 'google-site-kit' - ) - ) } - { ! trackingDisabled.length && - __( - 'Analytics is currently enabled for all visitors', - 'google-site-kit' +

+
+ + { __( 'Excluded from Analytics', 'google-site-kit' ) } + +

+ { !! trackingDisabled.length && + trackingDisabled + .map( + ( exclusion ) => + trackingExclusionLabels[ exclusion ] + ) + .join( + _x( ', ', 'list separator', 'google-site-kit' ) ) } -

-
+ { ! trackingDisabled.length && + __( + 'Analytics is currently enabled for all visitors', + 'google-site-kit' + ) } +

- - { /* Prevent the Ads Conversion ID setting displaying after this field has been - migrated to the Ads module, even after resetting the Analytics module. */ } - { useSnippet && - ! adsConversionIDMigratedAtMs && - !! adsConversionID && ( -
-
- - { __( 'Ads Conversion ID', 'google-site-kit' ) } - -

- { !! adsConversionID && ( - - ) } - { ! adsConversionID && - __( 'None', 'google-site-kit' ) } -

-
-
- ) } - +
); } diff --git a/assets/js/modules/analytics-4/components/setup/SetupForm.stories.js b/assets/js/modules/analytics-4/components/setup/SetupForm.stories.js index bd72d5f4413..364002eb355 100644 --- a/assets/js/modules/analytics-4/components/setup/SetupForm.stories.js +++ b/assets/js/modules/analytics-4/components/setup/SetupForm.stories.js @@ -83,9 +83,6 @@ export default { provideSiteInfo( registry ); provideModuleRegistrations( registry ); - registry.dispatch( MODULES_ANALYTICS_4 ).receiveGetSettings( { - adsConversionID: '', - } ); registry .dispatch( MODULES_ANALYTICS_4 ) .receiveGetExistingTag( null ); diff --git a/assets/js/modules/analytics-4/components/setup/SetupForm.test.js b/assets/js/modules/analytics-4/components/setup/SetupForm.test.js index 7e852d2a9c2..a3ae5313684 100644 --- a/assets/js/modules/analytics-4/components/setup/SetupForm.test.js +++ b/assets/js/modules/analytics-4/components/setup/SetupForm.test.js @@ -195,9 +195,6 @@ describe( 'SetupForm', () => { } ); it( 'submits the form upon pressing the CTA', async () => { - registry.dispatch( MODULES_ANALYTICS_4 ).setSettings( { - adsConversionID: '', - } ); registry.dispatch( MODULES_TAGMANAGER ).setSettings( {} ); registry .dispatch( MODULES_ANALYTICS_4 ) diff --git a/assets/js/modules/analytics-4/components/setup/__snapshots__/SetupForm.test.js.snap b/assets/js/modules/analytics-4/components/setup/__snapshots__/SetupForm.test.js.snap index 0f34bbbd415..744c58566ee 100644 --- a/assets/js/modules/analytics-4/components/setup/__snapshots__/SetupForm.test.js.snap +++ b/assets/js/modules/analytics-4/components/setup/__snapshots__/SetupForm.test.js.snap @@ -207,7 +207,6 @@ exports[`SetupForm renders the form correctly 1`] = ` >