-
Notifications
You must be signed in to change notification settings - Fork 21
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
Show promo for setting up Google Ads on the product feed tabs #2539
Comments
This will likely be blocked until #2599 is resolved. |
@joemcgill I've added the IB. Can you kindly take a look and let me know please? |
There is an existing issue with I think we can fix this by replacing the TODO comment in the diff --git a/js/src/hooks/useAdsCampaigns.js b/js/src/hooks/useAdsCampaigns.js
index 5975aec45..235b12a6a 100644
--- a/js/src/hooks/useAdsCampaigns.js
+++ b/js/src/hooks/useAdsCampaigns.js
@@ -7,7 +7,7 @@ import { useSelect } from '@wordpress/data';
* Internal dependencies
*/
import { STORE_KEY } from '.~/data';
-import { glaData } from '.~/constants';
+import useGoogleAdsAccount from '.~/hooks/useGoogleAdsAccount';
import useIsEqualRefValue from '.~/hooks/useIsEqualRefValue';
const selectorName = 'getAdsCampaigns';
@@ -30,16 +30,12 @@ const selectorName = 'getAdsCampaigns';
*/
const useAdsCampaigns = ( ...query ) => {
const queryRefValue = useIsEqualRefValue( query );
+ const { hasGoogleAdsConnection, hasFinishedResolution } =
+ useGoogleAdsAccount();
return useSelect(
( select ) => {
- // TODO: ideally adsSetupComplete should be retrieved from API endpoint
- // and then put into wp-data.
- // With that in place, then we don't need to depend on glaData
- // which requires force reload using window.location.href.
- const { adsSetupComplete } = glaData;
-
- if ( ! adsSetupComplete ) {
+ if ( hasFinishedResolution && ! hasGoogleAdsConnection ) {
return {
loading: false,
loaded: true, |
I think we should reuse the |
The |
Show promo for setting up Google Ads on the product feed tabs #2539
Part of #2460
Once a merchant has approved products in their product feed, we want to make it easy for them to start running ads for those products by adding a promo for creating their first campaign on the product feed overview card.
Acceptance Criteria
Implementation Brief
js/src/product-feed/product-statistics
,create-campaign-notice.js
which will house theCreateCampaignNotice
component.CreateCampaignNotice
,useMCProductStatistics
hook to determine whether there are approved products.useAdsCampaigns
hook (see this update to ensure that hook always checks for campaigns when a Google Ads account is connected).null
.Notice
component with custom class name for styling.js/src/components/paid-ads/add-paid-campaign-button.js
component, but pass a new context to the eventProps calledproduct-statistics-card
.js/src/product-feed/product-statistics/index.js
to includeCreateCampaignNotice
Test Coverage
Definition Questions
AppNotice
and style for this project?The text was updated successfully, but these errors were encountered: