Skip to content
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 feature tour for GA4 metrics #6554

Closed
nfmohit opened this issue Feb 8, 2023 · 14 comments
Closed

Add feature tour for GA4 metrics #6554

nfmohit opened this issue Feb 8, 2023 · 14 comments
Labels
Exp: SP Module: Analytics Google Analytics module related issues P0 High priority Type: Enhancement Improvement of an existing feature

Comments

@nfmohit
Copy link
Collaborator

nfmohit commented Feb 8, 2023

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) returns true. This should be built behind the ga4Reporting 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:
image


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

  • Create a new assets/js/feature-tours/ga4-reporting.js file that exports an object with the following properties:
    • slug - ga4Reporting
    • contexts - an array with VIEW_CONTEXT_MAIN_DASHBOARD constant
    • version - 1.98.0
    • gaEventCategory - a callback function that returns ${ viewContext }_dashboard-ga4-reporting value
    • steps - should be an array of object that list all steps defined in the figma design
    • checkRequirements - a callback that should return TRUE if the ga4Reporting feature flag is enabled for the site
  • In the assets/js/googlesitekit/datastore/user/feature-tours.js file:
    • Update the initial value of the currentTour property in the state to be undefined instead of null.
    • Rework the triggerTourForView action to call the receiveCurrentTour( null ) at the very end of the function and return null.
  • Update the useInView hook in the assets/js/hooks/useInView.js file:
    • Get the value of the forceInView property from the core/ui datastore (use select( CORE_UI ).get( 'forceInView' ) to get it)
    • Add one more useEffect to the hook that will call setHasBeenInViewOnce( true ) if the forceInView value is truthy.
  • In the assets/js/modules/search-console/components/dashboard/SearchFunnelWidgetGA4/Overview/index.js file:
    • Get the current feature tour using the getCurrentTour tour selector.
    • Add a new useEffect hook that sets the forceInView value to true in the core/ui datastore and dispatches the triggerOnDemandTour action passing the ga4Reporting feature tour defined above when all selectors are resolved (the component is ready for rendering) and if:
      • the current feature tour is null,
      • showGA4 is truthy,
      • and the dashboard type is DASHBOARD_TYPE_MAIN.

Test Coverage

  • Update existing js tests for feature tour actions and selectors affected by the aforementioned changes.

QA Brief

  • Set up a new site and connect the plugin
  • Enable the ga4Reporting feature flag
  • Go to the dashboard and verify that you see the aforementioned feature tour
    • If you see another feature tour, then just close it, delete session cache in the console and reload the page.

Changelog entry

  • Add a feature tour for new metrics that are available on the GA4 version of the dashboard.
@nfmohit nfmohit added the Type: Enhancement Improvement of an existing feature label Feb 8, 2023
@mxbclang mxbclang added the P0 High priority label Feb 27, 2023
@nfmohit nfmohit self-assigned this Mar 7, 2023
@nfmohit nfmohit removed their assignment Mar 15, 2023
@tofumatt tofumatt removed their assignment Mar 15, 2023
@eugene-manuilov eugene-manuilov self-assigned this Mar 16, 2023
@tofumatt
Copy link
Collaborator

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

@eugene-manuilov eugene-manuilov added Exp: SP Module: Analytics Google Analytics module related issues labels Mar 17, 2023
@eugene-manuilov
Copy link
Collaborator

@tofumatt, could you please review IB?

@tofumatt
Copy link
Collaborator

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 👍🏻

@tofumatt tofumatt assigned eugene-manuilov and unassigned tofumatt Mar 21, 2023
@eugene-manuilov
Copy link
Collaborator

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.

@tofumatt
Copy link
Collaborator

This is awesome 👍🏻

IB ✅

@tofumatt tofumatt removed their assignment Mar 22, 2023
@eugene-manuilov eugene-manuilov self-assigned this Mar 23, 2023
@eugene-manuilov
Copy link
Collaborator

@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?

@marrrmarrr
Copy link
Collaborator

marrrmarrr commented Apr 11, 2023

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:

@eugene-manuilov
Copy link
Collaborator

Thanks, @marrrmarrr. Can you give me the correct title and description for each step since text on the Figma design is outdated?

@aaemnnosttv
Copy link
Collaborator

@eugene-manuilov would you please add a QAB?

@eugene-manuilov eugene-manuilov removed their assignment Apr 12, 2023
@mohitwp mohitwp self-assigned this Apr 12, 2023
@mohitwp
Copy link
Collaborator

mohitwp commented Apr 13, 2023

QA Update ⚠️

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-

  • 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.

@wpdarren
Copy link
Collaborator

@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?

image

@wpdarren wpdarren removed their assignment Apr 13, 2023
@mohitwp
Copy link
Collaborator

mohitwp commented Apr 13, 2023

@wpdarren I also tested using oi.ie site. But it is not triggered for me.

@eugene-manuilov
Copy link
Collaborator

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.

image

@mohitwp
Copy link
Collaborator

mohitwp commented Apr 14, 2023

QA Update ✅

  • Tested on dev environment.
  • Verified feature tour is getting trigger when we switch to Ga4 Dashboard view.
  • Verified the feature tour gets permanently dismissed upon completion/dismissal
  • Verified the feature tour appear on the main Site Kit dashboard as soon as isGA4DashboardView returns true.

Note :

  • Under actual implementation, font size and Font family is different from figma. We implement the same font family and size as we are using for existing feature tours.
  • Also, copy in figma is different and not correct. Copy under current implementation is correct.

image

image

image

@mohitwp mohitwp removed their assignment Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Exp: SP Module: Analytics Google Analytics module related issues P0 High priority Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

8 participants