diff --git a/assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/Overview.js b/assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/Overview.js index 4204a907245..fab91fd9d17 100644 --- a/assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/Overview.js +++ b/assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/Overview.js @@ -118,6 +118,9 @@ const Overview = ( { const isSearchConsoleGatheringData = useInViewSelect( ( select ) => select( MODULES_SEARCH_CONSOLE ).isGatheringData() ); + const isAuthenticated = useSelect( ( select ) => + select( CORE_USER ).isAuthenticated() + ); const { totalClicks, @@ -172,6 +175,7 @@ const Overview = ( { ! error ); const showGoalsCTA = + isAuthenticated && showAnalytics && dashboardType === DASHBOARD_TYPE_MAIN && ! analyticsGoalsData?.items?.length; diff --git a/assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/index.stories.js b/assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/index.stories.js index 8cd9568dd53..72f8743f6af 100644 --- a/assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/index.stories.js +++ b/assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/index.stories.js @@ -24,6 +24,7 @@ import { provideModuleRegistrations, provideModules, provideSiteInfo, + provideUserAuthentication, provideUserCapabilities, WithTestRegistry, } from '../../../../../../../tests/js/utils'; @@ -258,6 +259,7 @@ export const ReadyWithCreateGoalCTA = Template.bind( {} ); ReadyWithCreateGoalCTA.storyName = 'Ready with Create Goal CTA'; ReadyWithCreateGoalCTA.args = { setupRegistry: ( registry ) => { + provideUserAuthentication( registry ); provideSearchConsoleMockReport( registry, searchConsoleArgs ); for ( const options of analyticsArgs ) { provideAnalyticsMockReport( registry, options );