Closed aaemnnosttv closed 4 months ago
I made some changes here, mainly adding more clarity around the widget behaviour/expectations for the component, but also removing the need to pass in the config or services, since I think the PAX component itself can handle that (they'll be consistent across the site as I understand it).
@10upsimon Let me know if this looks good, if so feel free to move it right to IB ππ»
Thanks @tofumatt those changes look good to me, moving to IB
IB βοΈ
I tweaked the definition here to include the use of whenActive
plus a new HOC for guarding based on a granted scope, since it is conditional for Ads at this point. The estimate was also bumped to accommodate for this.
@tofumatt a few observations:
To note: I have successfully set up my campaign, clicked on the update button to connect the Ads module.
POST https://ads.google.com/aw_express/embedding/_/rpc/EmbeddedMiniDashboardViewModelService/LoadViewModel?authuser&acx-v-bv=awn_express_auto_20240508-0457_RC000&acx-v clt=1715737524077&rpcTrackingId=EmbeddedMiniDashboardViewModelService.LoadViewModel%3A1 500 (Internal Server Error)
2. If Analytics is not connected then the widget does not appear. We could have a scenario where the user does not have this module set up, so, should the widget appear? I suspect it should since Ads and Analytics are not directly impacted for setting up an ads account and campaign. The widget actually appears, tested on another site. Please ignore.
Turns out that bug was due to the date range code not being merged yet.
Now that #8687 is merged this should work, so moving back to QA ππ»
@zutigrm The UX/UI of the widget doesn't look very good.
There's lots of white space, wrapping issues with text, etc. Interested in your thoughts considering its a pilot.
@wpdarren thanks for your observation. As @tofumatt mentioned in the slack we can't control the widget, since it is third party and it can adjusted only on the Ads team side
Verified:
Note that there are numerous UX/UI issues with the reporting widget, but we will identify these to the Ads team to see if they can be fixed and make the widget more user-friendly.
Feature Description
With Ads connected via PAX, the Ads module should conditionally register a new widget on the dashboard which be populated by a new PAX widget, the contents of are WIP but delegated to the app.
This widget should appear in the "Traffic" section, and will not be accessible to users in the view-only dashboard context.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
PartnerAdsWidget
or similar) within the Ads module. It should render the PAX application in "reporting" mode (likely via adisplayMode
or similar prop of the main PAX component, see #8557).adsPax
feature flag is present and the Ads module is connected, and the adwords scope is granted (see #8565)Widget
component.Implementation Brief
PartnerAdsWidget
) in the Ads module that will render the PAX application in "reporting" mode. The file should be located inassets/js/modules/ads/components/dashboard/PartnerAdsWidget.js
.whenActive
HOC to ensure the widget is only rendered when theads
module is connectedwhenScopesGranted
similar towhenActive
but requiring one or more scopes are granted (checkinghasScope
in the core/user store) which rendersWidgetNull
as a Fallback if conditions are not satisfiedcompose
to combine these together (example)adsPax
feature flag is present. The widget should be registered in a newregisterWidgets
function inassets/js/modules/ads/index.js
.registerWidgets
function should mimic existingregisterWidgets
functions, see https://github.com/google/site-kit-wp/blob/9e8bcc41e45d8ed7fe84dbd52ed1e7d3e316ed40/assets/js/modules/adsense/index.js#L91 as an example.PAXEmbeddedApp
component in"reporting"
display mode, wrapped by a<Widget>
component.PAXEmbeddedApp
if an Ad Blocker is detected.Test Coverage
QA Brief
adsModule
andadsPax
feature flags.adsPax
feature flag.Changelog entry