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 a small overlay/callout to AdSense + GA4 users whose accounts are not linked #8236
Comments
@tofumatt @marrrmarrr Nitpick here, but should this be "The top earning content metric is now available..." instead of just "Top earning content metric is now available..."? That reads better to me, but LMK what you think! |
Assigning this a rough estimate of 15 just for planning purposes, but as soon as someone can take on the IB it might need slight adjustment. |
Increasing this estimate to 19 after adding the Showing only one overlay on-screen at a time section. |
@tofumatt how about moving this logic into datastores? We have the UI datastore that can control which overlay notification should be shown and control how many of them can be displayed. So, instead of creating a new hook, we can add a new action This will also let us remove a need to pack the module related logic in the global component. For example, we can update a resolver in the Analytics 4 module that will "trigger" that overlay when we pull related information. WDYT? |
@eugene-manuilov Oh, thanks, that's a much better design! 👌🏻 I'll amend the IB here with that approach 👍🏻 |
Having thought about it more, I'm actually pretty sure the existing system would meet those requirements largely. The hook is an abstraction that allows components to easily setup the logic to show/hide themselves and abstracts the calls needed, but ultimately the component that will render is controlled by the datastore… it would still be possible to trigger a particular overlay with: dispatch( CORE_UI ).setValue( OVERLAY_NOTIFICATION_TO_SHOW, 'someOverlay' ); And I think we'd want to have an <Fragment>
<LinkAnalyticsAndAdSenseAccountsOverlayNotification />
<SomeOtherOverlayNotificationWeMakeLater />
</Fragment> I've added that last bit to the IB for clarity, but when I tried making the datastore responsible for selecting the component directly I then needed to create a map of values-to-components, which felt pretty similar to what I've proposed, just in a different way. But the approach I'm proposing means that for simpler notifications like this one, it can run its logic for displaying inside itself, but there's still the ability to dispatch an action elsewhere to trigger a different notification. |
Ok, let it be it. IB ✔️ |
Note, since this issue will introduce the logic for showing only one overlay, it can be used to adapt #8238 notification that should not be shown if the callout from this issue is shown |
I've closed that, as the ACs for this issue include that point and it's an important part of this issue, so it will need to be done as part of this 🙂 (Also, the conditions to render each notification should be mutually exclusive so it won't happen, but I may check to see if one is rendered to prevent the other from rendering, just in case 😄) |
QA Update:
|
@wpdarren Oh, it shouldn't appear on the entity page, that's a good point. I thought I checked for that but maybe I forgot to do it as part of this issue 🤔 I think the right-aligned on mobile is fine, that was just a suggestion really but not a requirement. But if it's appearing on the entity dashboard please move this back to Execution and I'll fix that 👍🏻 |
QA Update: ❌The overlay is appearing on the entity dashboard, so sending it back to @tofumatt to fix. |
Back with you for another pass, @wpdarren. |
QA Update: ✅Verified
|
Feature Description
A new callout (styled somewhat similarly to our surveys in the bottom-right of the screen) should be added for users who have AdSense and GA4 connected, but whose accounts are not detected as "linked".
Figma design: https://www.figma.com/file/7ba0pj1rLuvLvJhy3NiHOj/AdSense?type=design&node-id=7-13&mode=design&t=CHIb34EcBQchWxBL-0
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
ga4AdSenseIntegration
feature flag (Addga4AdSenseIntegration
feature flag #8288) is enabled. When it is disabled, there should be no overlay/prompt shown.adSenseLinked
setting (see UpdateAnalytics_4
settings to include AdSense Link-related Settings fields (adSenseLinked
andadSenseLinkedLastSyncedAt
) #8047) is not set, an overlay prompting them to connect their accounts (see screenshot/Figma design) should appear in the bottom-right corner of the page.AdSenseLinkCTA
eg.:Implementation Brief
assets/js/components/OverlayNotification
OverlayNotificationBase
) in a file (assets/js/components/OverlayNotification/base.js
) for the structure of this notification, it can borrow a fair bit of style from thesurveys
components eg.site-kit-wp/assets/js/components/surveys/CurrentSurvey.js
Lines 284 to 289 in cd27c39
site-kit-wp/assets/sass/components/surveys/_googlesitekit-surveys.scss
Line 21 in cd27c39
assets/sass/components/overlay-notification.scss
assets/js/components/OverlayNotification/LinkAnalyticsAndAdSenseAccountsOverlayNotification.js
) using theOverlayNotificationBase
component with this overlay's content, roughly:className
s/styles where appropriate/possible. New ones can be created inassets/sass/components/overlay-notification.scss
.LINK_ANALYTICS_ADSENSE_OVERLAY_DISMISSED = 'link-analytics-and-adsense-overlay';
)const { dismissItem } = useDispatch( CORE_USER );
anddismissItem( LINK_ANALYTICS_ADSENSE_OVERLAY_DISMISSED )
supportURL
value mentioned in the ACs, in a new tab/window. (Thearia-label
for this button should mention to the user it will open in a new window).null
when:ga4AdSenseIntegration
feature flag is disabledselect( MODULES_ANALYTICS_4 ).getAdSenseLinked()
istrue
select( CORE_USER ).isItemDismissed( LINK_ANALYTICS_ADSENSE_OVERLAY_DISMISSED )
istrue
Showing only one overlay on-screen at a time
Because this pattern will be used for at least two notifications now (and likely will expand in the future), we should implement at least a basic system that prevents multiple overlays from appearing at the same time/on the same page-load.
Right now we can probably start simple, where only one notification can render itself at a time. It's probably fine to start by having every notification call its render function and whichever one determines it should render, dispatch the to the
CORE_UI
store to be the one the user sees for this page load.In the future, we could add things like priority, etc., but this simple approach will work for now. A hook that allows us to check if a notification should be shown and allows us to set the active one (based on the first notification to meet all of its "should render" requirements) in
assets/js/hooks/useOverlayNotification.js
could look like:assets/js/components/OverlayNotification/LinkAnalyticsAndAdSenseAccountsOverlayNotification.js
) could use it as such:There should be an
OverlayRenderer
component that outputs all overlays, which will allow the "active" one (if one exists) to be output, eg:This can be made in
assets/js/components/OverlayNotification/OverlayRenderer.js
and should be output inDashboardMainApp
or similar.Test Coverage
useOverlayNotification
hook ensuring it does not change the "active" component after it is set, does not set any components to output by default, etc.LinkAnalyticsAndAdSenseAccountsOverlayNotification
component.QA Brief
adSenseLinked
is not receiving real data, it will already befalse
by defaultga4AdSenseIntegration
feature flagLearn how
button should open a help article in new tab and dismiss notificationMaybe later
should just dismiss the notificationChangelog entry
The text was updated successfully, but these errors were encountered: