-
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
Remove the accounts connection page from the Ads Setup flow. #2595
base: feature/2459-campaign-creation-flow
Are you sure you want to change the base?
Remove the accounts connection page from the Ads Setup flow. #2595
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kt-12 Can you please do the following:
- Change the target branch for your PR to feature/2460-simplify-paid-ads-setup as per the IB.
- Fix the linting errors.
- Review the E2E tests. For e.g there's empty tests for
Set up your accounts page
intests/e2e/specs/add-paid-campaigns/add-paid-campaigns.test.js
…//github.com/woocommerce/google-listings-and-ads into feature/2534-remove-accounts-connection-page
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2595 +/- ##
============================================
- Coverage 65.0% 62.7% -2.4%
============================================
Files 475 319 -156
Lines 17900 5080 -12820
Branches 0 1233 +1233
============================================
- Hits 11640 3183 -8457
+ Misses 6260 1724 -4536
- Partials 0 173 +173
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM @kt-12
QA/Test Report- ✅Testing Environment -
Test Results - Tested the functionally of the new changes. Working as described in scope. ✅ Functional Demo / Screencast - GLNA.mp4Next Step- Ready to Code Review(Woo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the comments left, there are two other issues:
- The merge base should be the
feature/2460-simplify-paid-ads-setup
branch rather thandevelop
. - The e2e testing failed: https://github.com/woocommerce/google-listings-and-ads/actions/runs/11029983509/job/30633596790
@eason9487 I have addressed your review comment. I have also fixed E2E to reflect the current flow. |
Sorry for the branch name confusion. We've consolidated feature/2460-simplify-paid-ads-setup into feature/2459-campaign-creation-flow. This should be correct now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good and are working as expected. The accounts connection page has been removed from the Paid Ads setup screen. Both the paid ads campaign creation and the edit paid campaign functions are working fine. ✅
if ( initHasAdsConnectionRef.current === null ) { | ||
initHasAdsConnectionRef.current = hasGoogleAdsConnection; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed this check is not enough to skip the first step. Without the following checks, the Google Ads account claiming and connection with Google Merchant Center account could be skipped.
google-listings-and-ads/js/src/setup-ads/ads-stepper/setup-accounts/index.js
Lines 35 to 41 in bfec773
// Ads is ready when we have a connection and verified and verified access. | |
// Billing is not required, and the 'link_merchant' step will be resolved | |
// when the MC the account is connected. | |
const isGoogleAdsReady = | |
hasGoogleAdsConnection && | |
hasAccess && | |
[ '', 'billing', 'link_merchant' ].includes( step ); |
Steps to reproduce:
Kapture.2024-10-04.at.17.44.59.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. We hadn't considered the claim state here.
Co-authored-by: Eason <[email protected]>
@eason9487 I've addressed both concerns and was able to validate that the step remains visible whenever the account needs to be claimed. E2E tests are still passing after applying your suggestion. Can you look again? |
const { hasAccess } = useGoogleAdsAccountStatus(); | ||
const initHasAdsConnectionRef = useRef( null ); | ||
|
||
const isGoogleAdsReady = hasGoogleAdsConnection && hasAccess; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking hasAccess
only may still skip creating the conversion action of Google Ads account and connection to Google Merchant Center account. The step
in ads/account-status
API response may be stalled in 'conversion_action'
status.
Steps to reproduce:
- Select to create new Google Ads account
- Open the pop-up window for claiming account but don't proceed to claim
- Close the webpage of Ads-onboarding flow
- Claim account via the pop-up window
- Open new webpage to visit the Ads-onboarding flow again
- The flow starts from the paid campaign setup step
if ( ! googleAdsAccount ) { | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useGoogleAdsAccount
and useGoogleAdsAccountStatus
are concurrent asynchronous requests. Only checking googleAdsAccount
can't guarantee that the required data have been obtained to get the correct value of initHasAdsConnectionRef.current
.
When useGoogleAdsAccount
responds first and a Google ads account has been already fully connected, three steps will flash for a moment.
Kapture.2024-10-07.at.17.43.42.mp4
Also, when a Google Ads account is claimed but not yet fully connected such as #2595 (comment), three steps will flash for a moment as well.
Kapture.2024-10-07.at.17.36.12.mp4
The issues can be simulated by adding delays to the API request of useGoogleAdsAccountStatus
.
import { __unstableAwaitPromise } from '@wordpress/data-controls';
export function* getGoogleAdsAccountStatus() {
// Add this at the position needed a delay
yield __unstableAwaitPromise( new Promise( ( resolve ) => setTimeout( resolve, 3000 ) ) );
yield fetchGoogleAdsAccountStatus();
}
Changes proposed in this Pull Request:
Closes #2534.
Replace this with a good description of your changes & reasoning.
Screenshots:
After removal of accounts setup page.
Detailed test instructions:
gla_ads_setup_completed_at
options.Performance (Paid Campaigns)
section clickAdd paid campaign
Setup accounts page
as shown in the screenshot. Proceed with the other steps and see if you are able to create first paid campaign.Additional details:
Changelog entry