-
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
Add the “Switch to GA4 Dashboard View” notification banner #6544
Comments
ACs here are good 👍🏻 |
Hey @hussain-t, good work so far on the IB here. I have a couple of comments:
|
I think we should use property creation date over days of row count, given we already need that date in #6572. I mentioned as much in #6623 (comment). If that sounds good we should update the ACs here, let me know what you think @techanvil. |
Thanks, @techanvil @tofumatt. Using the property's |
Thanks @tofumatt and @hussain-t, using the creation time of the property SGTM. I've updated the AC and the IB also LGTM. :) IB ✅ |
Note, there was a mistake in the issue description about the requirement of Thank you @kuasha420 for spotting this! |
Thank @nfmohit for the quick amendment. As par our discussion, I'd like a bit more clarification on the last point of AC. The issue description says the Banner should only be displayed when Currently in IB, we're getting From discussion with @nfmohit, It seems that the intention is to only show the Banner if the GA4 property is not in gathering data state and has data (including zero data) in addition to property being at least 3 days old. This is very similar to the logic in the aforementioned I'm not super familiar with the implementation of ga4
Please let me know what you think. Cheers. |
Hmm. Well, IIRC the decision for the GA4 "gathering data" state to include a check for the property to be under two days old was taken in a discussion with @marrrmarrr; I am not sure how the requirement for there to be at least three days of data to show this "Switch to GA4 Dashboard View" banner was arrived at but it's ultimately another product decision, so I think the best thing to do here would be to bring Mariya into the discussion and ask for her input on it - if we can synchronise these two similar but currently separate sounding requirements that would obviously make for a simpler implementation, but otherwise we'll need to implement with two separate checks. |
@techanvil @kuasha420 IIRC the "3 days old" requirement for inviting users to switch over the dashboard to GA4 stats was arrived at by confirming what's the longest time it might take for stats to appear in GA (max 48hrs according to the official docs) and adding an extra day to that, just to be on the safe side. The idea is that if the user has recently added GA4, it would be a better experience if they can see at least some stats directly after they switch the dashboard. |
Thanks @marrrmarrr - sounds good and would be a nice straightforward path conceptually and in terms of implementation. |
@marrrmarrr @techanvil Thank you both. I have gone ahead and updated the gathering data selector to 3 days. This made everything cleaner. This is ready for CR. Cheers. |
QA Update:
|
Hi @wpdarren, Thanks for sharing your observation.
Cheers. |
QA Update: ✅Verified: Note: I have added a few issues to the bug bash board for the banner. The graphic and 'Learn what's new' link are not the same as figma but are known issues. Details on the Asana ticket.
Arafat confirmed that these are expected. |
Approval
|
Based on our internal discussion, I have opened #6840 so that we can fine control when this banner notification should reappear after dismissal. Thank you @aaemnnosttv! |
Feature Description
A new
BannerNotification
should be added that will prompt users to switch their sites to the GA4 dashboard view. It should be according to the Figma design.To find out if this
BannerNotification
should be displayed, ashouldPromptGA4DashboardView
selector should be added to theanalytics-4
datastore. This selector should returntrue
if GA4 is connected,isGA4DashboardView
selector (being implemented in #6541) returnsfalse
, the aboveBannerNotification
is not dismissed, and GA4 is not in a gathering data state and it has at least 3 days of data.The
BannerNotification
should only be shown if theshouldPromptGA4DashboardView
selector returnstrue
, and thega4Reporting
feature flag is enabled.Clicking the CTA should update the
dashboardView
Analytics
module setting (being added in #6540) to GA4, thus switching the dashboard view to GA4.Dismissing the banner should do so persistently.
Here is the relevant part in the design doc.
Here is a screenshot for visual aid:
This
BannerNotification
will later be removed as a part of #6549.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
BannerNotification
should be created according to this Figma design.Display data from Google Analytics 4 on your dashboard
Update your dashboard to show data from the new version of Analytics (Google Analytics 4) instead of the old version (Universal Analytics). Learn what’s new
.Update dashboard
CTA should change thedashboardView
Analytics
module setting (being added in New Analytics module setting to store dashboard view #6540) togoogle-analytics-4
.BannerNotification
usingMaybe later
should permanently dismiss it.analytics-4
datastore should have a new selector added that indicates if a user should be prompted to switch their site to the GA4 dashboard view, sayshouldPromptGA4DashboardView()
. This selector should returntrue
if the following conditions are met:isGA4DashboardView()
selector in theanalytics-4
datastore (being implemented in AddisGA4DashboardView
selector #6541) returnsfalse
.BannerNotification
should be rendered in the client only if the aboveshouldPromptGA4DashboardView()
selector returnstrue
.Implementation Brief
Create the Selector
Note: The
shouldPromptGA4DashboardView
selector should be added to theanalytics
datastore; similarly, we have added theisGA4DashboardView
selector to theanalytics
datastore.In
assets/js/modules/analytics/datastore/settings.js
:shouldPromptGA4DashboardView()
. It should returntrue
if the following conditions are met:isModuleConnected()
selector.isGA4DashboardView()
selector of theanalytics
datastore returnsfalse
.isGatheringData()
selector of theanalytics-4
datastore.getReport
selector of theanalytics-4
datastore. The args should be:startDate
,endDate
,metrics
:[{ name: 'totalUsers' }]
dimensions
:[{ name: 'date' }]
getReport
selector of theanalytics-4
datastore.true
if the property'screateTime
is greater than or equal to 3 days. Similar to theisGatheringData()
selector that checks for 2 days.false
.Create the Notification Component
Create a new component,
SwitchGA4DashboardViewNotification
inassets/js/components/notifications
:BannerNotification
component if theshouldPromptGA4DashboardView()
selector of theanalytics
datastore returnstrue
with the following props:id
:switch-ga4-dashboard-view
title
:Display data from Google Analytics 4 on your dashboard
description
:Update your dashboard to show data from the new version of Analytics (Google Analytics 4) instead of the old version (Universal Analytics).
.ctaComponent
: Pass theSpinnerButton
component with the following props:onClick
: A callback that dispatches thesetDashboardView
withgoogle-analytics-4
andsaveSettings
actions of theanalytics
datastore.children
:Update dashboard
dismiss
:Maybe later
WinImageSVG
:assets/svg/graphics/ga4-success-green.svg
learnMoreLabel
:Learn what’s new
learnMoreURL
: Obtain it from thegetDocumentationLinkURL
selector of thecore/site
datastore with thega4
as theslug
.SwitchGA4DashboardViewNotification
component.Test Coverage
shouldPromptGA4DashboardView()
inassets/js/modules/analytics/datastore/settings.test.js
.SwitchGA4DashboardViewNotification
.QA Brief
ga4Reporting
and connect Analytics module with both UA and GA property.Changelog entry
The text was updated successfully, but these errors were encountered: