-
Notifications
You must be signed in to change notification settings - Fork 293
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
Hook up the Setup Component CTA to create/connect the property and measurement ID #5277
Comments
IB ✔️ |
Update: I've realised that this issue should be covering the case where an existing property does exist too. The implementation should not need to change for this, but I will hold off merging the PR for this issue until #5793 has been merged so we can confirm that it does indeed work for both cases. Additionally the QAB will need to be updated to cover the "existing property" scenario as well (see the updated QAB for #5276). |
Create property and measurement ID from SetupBanner
QA Update:
|
QA Update: ✅The flicker issue reported above will be fixed as part of 5276, so moving this to approved as the test pass QAB. Verified: No GA4 property available:
Screencastsga4-1.mp4ga4-2.mp4 |
Approval
|
The initial issue was that the screen flickers when the button is created, so this progress bar was introduced because of that. Since 5276 is in QA, should both of these tickets but looked at because the progress bar does appear on screen after clicking on the button in the different states. c.c. @nfmohit @techanvil |
Approval ✅@wpdarren Tested this again on my side, UI looks good to me now. There no longer is the progress bar together with the button spinner when creating a new GA4 property. |
Feature Description
Call the GA4
submitChanges
function when the Setup Component CTA is clicked. This function will create the property and/or measurement ID and connect them.For the "no existing GA4 property" variants, i.e when the CTA is Create property, ensure the GA4
propertyID
is set toPROPERTY_CREATE
prior to callingsubmitChanges
.Modify the
BannerNotification
component to allow the Button with Spinner to be used for the CTA button and show the spinner while the API calls made bysubmitChanges
are in progress.If an error occurs, display the error message in the banner.
Acceptance criteria
submitChanges
function.Implementation Brief
In
assets/js/components/notifications/BannerNotification/index.js
:ctaButton
, that composes the CTA button.ctaButton
as children if it's available. It renders whatever the element is passed. In this case, it would be aButton
with aSpinner
reusable component, which is being implemented in Create Button with Spinner component #5271.Button
and theSpinner
components as it is today.site-kit-wp/assets/js/components/notifications/BannerNotification/index.js
Lines 399 to 411 in 989112d
The Setup Component is being Implemented in #5270 and #5275. Add the following logic to the Setup Component:
error
to store the error object.handleSubmitChanges
async callback using theuseCallback
hook with the following:submitChanges()
action of theMODULES_ANALYTICS_4
store.error
object from thesubmitChanges
action result.error
object to the error state.error
, display the error message in the banner by rendering theErrorNotice
component and pass theerror
state to theerror
prop.handleSubmitChanges
callback to theonClick
prop.ctaButton
prop of theBannerNotification
component. This will be rendered as the CTA button.Test Coverage
QA Brief
ga4ActivationBanner
feature flag is activated.No GA4 property available
:Set up now
in the displayed GA4 Activation Banner.No existing Google Analytics 4 property found
heading, ifCreate Property
is clicked, it should show a spinner and create a new GA4 property and measurement ID.GA4 properties exist, but not connected
:Set up now
in the displayed GA4 Activation Banner.Connect the Google Analytics 4 property that’s associated with your existing Universal Analytics property
heading, selecting a property and clicking onConnect
should show a spinner and create a new GA4 property and measurement ID.Changelog entry
The text was updated successfully, but these errors were encountered: