Closed nfmohit closed 1 year ago
For posterity, here's a link to our Slack discussion for potential solutions to implement this given the isInViewSelect
issues posed here: https://10up.slack.com/archives/CBKKQEBR9/p1678975545428009
@tofumatt, could you please review IB?
Most of this seems good, and I think technically the approach will work okay, but compared to what we discussed on Slack it seems this IB is a trade-off… it's much easier to understand/implement, but it might possibly cause the feature tour to activate before resolvers have finished loading, which could mean DOM elements aren't yet rendered. This would mean React Joyride will reference DOM elements that don't exist and it could cause issues.
Though actually, I realised we could call the triggerOnDemandTour( 'ga4Reporting' )
in a component (like SearchFunnelWidgetGA4/Overview/index.js
) only once the component isn't in a loading state.
That would make this really slick and less fragile, since as soon as the components we care about render their contents we can trigger the tour.
Can you update the IB so that triggerOnDemandTour( 'ga4Reporting' )
is only called once any components we need to be in a non-loading state are fully-rendered?
I think then this is good-to-go, and it's better than my suggestion in Slack of waiting on resolvers themselves. Nice 👍🏻
Can you update the IB so that
triggerOnDemandTour( 'ga4Reporting' )
is only called once any components we need to be in a non-loading state are fully-rendered?
Thanks, @tofumatt. IB is updated.
This is awesome 👍🏻
IB ✅
@marrrmarrr could you please confirm that feature tour steps shown in the Figma design are correct? I am asking because on the Figma design we have Sessions
and Engaged Sessions
, but in the plugin we have Sessions
and Engagement Rate
. Also, some steps have "Learn more" links, which URLs should we use?
Hey @eugene-manuilov, confirming this metric should be "Engagement rate", as is currently in the plugin. I think the Figma designs might have gone slightly out of date, since they were completed before we had a few discussions with Tom on updating some metrics' naming.
In terms of the Learn More links:
Thanks, @marrrmarrr. Can you give me the correct title and description for each step since text on the Figma design is outdated?
@eugene-manuilov would you please add a QAB?
Tested on develop. @nfmohit GA4 dashboard feature tour is not getting trigger for me. I followed the below steps. Tested by creating new site and also tested using oi.ie with dev plugin.
@wpdarren Can you pleasLet me know if you are able to trigger feature tour for GA4.
Steps-
@mohitwp I was able to get this to work earlier this morning when writing up the bug bash instructions. Is your site in gathering state?
@wpdarren I also tested using oi.ie site. But it is not triggered for me.
Steps-
- Created new InstaWP site.
- 'ga4Reporting' Feature flag - DISABLED.
- Set up Site Kit with Analytics.
- 'ga4Reporting' Feature flag - ENABLED.
- Go to Site kit Dashboard.
- Site kit dashboard not automatically switching to GA4 when we enable 'ga4Reporting' feature flag.
- Enable GA4 view for Site kit dashboard from Settings.
- Go to Site kit Dashboard.
- No feature tour trigger for GA4 dashboard.
@mohitwp you need to clear your browser session storage because we have a delay (stored in the session storage) that prevents showing feature tours too often.
Note :
Feature Description
A new feature tour will be created as per the Figma designs, that will navigate the user throughout the new GA4 components. This feature tour should be triggered as soon as the user has switched to the GA4 dashboard view, i.e.
isGA4DashboardView
selector (being added in #6541) returnstrue
. This should be built behind thega4Reporting
feature flag.Since the feature tour will be persistently dismissed upon completion and dismissal, it will not show up again.
Here is the relevant section in the design doc.
Here is a screenshot for visual aid:
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
isGA4DashboardView()
returnstrue
Implementation Brief
assets/js/feature-tours/ga4-reporting.js
file that exports an object with the following properties:slug
-ga4Reporting
contexts
- an array withVIEW_CONTEXT_MAIN_DASHBOARD
constantversion
-1.98.0
gaEventCategory
- a callback function that returns${ viewContext }_dashboard-ga4-reporting
valuesteps
- should be an array of object that list all steps defined in the figma designcheckRequirements
- a callback that should returnTRUE
if thega4Reporting
feature flag is enabled for the siteassets/js/googlesitekit/datastore/user/feature-tours.js
file:currentTour
property in the state to beundefined
instead ofnull
.triggerTourForView
action to call thereceiveCurrentTour( null )
at the very end of the function and returnnull
.baseActions.triggerTour( tour )
action call, return thetour
itself right after calling the action: https://github.com/google/site-kit-wp/blob/f04ed052ce6b654378eb1e41cfdbe76f774b7692/assets/js/googlesitekit/datastore/user/feature-tours.js#L216useInView
hook in theassets/js/hooks/useInView.js
file:forceInView
property from thecore/ui
datastore (useselect( CORE_UI ).get( 'forceInView' )
to get it)useEffect
to the hook that will callsetHasBeenInViewOnce( true )
if theforceInView
value is truthy.assets/js/modules/search-console/components/dashboard/SearchFunnelWidgetGA4/Overview/index.js
file:getCurrentTour
tour selector.useEffect
hook that sets theforceInView
value to true in thecore/ui
datastore and dispatches thetriggerOnDemandTour
action passing thega4Reporting
feature tour defined above when all selectors are resolved (the component is ready for rendering) and if:null
,showGA4
is truthy,DASHBOARD_TYPE_MAIN
.Test Coverage
QA Brief
ga4Reporting
feature flagChangelog entry