Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/#6587 - Fix Search Funnel error when GA is in a gathering state #6606

Merged
merged 3 commits into from
Feb 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ import useDashboardType, {
DASHBOARD_TYPE_MAIN,
DASHBOARD_TYPE_ENTITY,
} from '../../../../../../hooks/useDashboardType';
import { CORE_USER } from '../../../../../../googlesitekit/datastore/user/constants';
import { MODULES_ANALYTICS } from '../../../../../analytics/datastore/constants';
import DataBlock from '../../../../../../components/DataBlock';
import useViewOnly from '../../../../../../hooks/useViewOnly';
import { CORE_USER } from '../../../../../../googlesitekit/datastore/user/constants';
import OptionalCells from './OptionalCells';
const { useSelect, useInViewSelect } = Data;

Expand Down Expand Up @@ -95,6 +96,11 @@ const Overview = ( {
select( CORE_MODULES ).isModuleActive( 'analytics' )
);

const isAnalyticsGatheringData = useInViewSelect(
( select ) =>
analyticsModuleConnected &&
select( MODULES_ANALYTICS ).isGatheringData()
);
const isSearchConsoleGatheringData = useInViewSelect( ( select ) =>
select( MODULES_SEARCH_CONSOLE ).isGatheringData()
);
Expand Down Expand Up @@ -193,13 +199,15 @@ const Overview = ( {
title: __( 'Total Impressions', 'google-site-kit' ),
datapoint: totalImpressions,
change: totalImpressionsChange,
isGatheringData: isSearchConsoleGatheringData,
},
{
id: 'clicks',
stat: 1,
title: __( 'Total Clicks', 'google-site-kit' ),
datapoint: totalClicks,
change: totalClicksChange,
isGatheringData: isSearchConsoleGatheringData,
},
...( showAnalytics
? [
Expand All @@ -212,6 +220,7 @@ const Overview = ( {
),
datapoint: analyticsVisitorsDatapoint,
change: analyticsVisitorsChange,
isGatheringData: isAnalyticsGatheringData,
},
]
: [] ),
Expand All @@ -225,6 +234,7 @@ const Overview = ( {
title: __( 'Goals', 'google-site-kit' ),
datapoint: analyticsGoalsDatapoint,
change: analyticsGoalsChange,
isGatheringData: isAnalyticsGatheringData,
},
]
: [] ),
Expand All @@ -237,6 +247,7 @@ const Overview = ( {
datapoint: analyticsBounceDatapoint,
datapointUnit: '%',
change: analyticsBounceChange,
isGatheringData: isAnalyticsGatheringData,
},
]
: [] ),
Expand Down Expand Up @@ -288,9 +299,7 @@ const Overview = ( {
selectedStats === dataBlock.stat
}
handleStatSelection={ handleStatsSelection }
gatheringData={
isSearchConsoleGatheringData
}
gatheringData={ dataBlock.isGatheringData }
/>
</Cell>
) ) }
Expand Down