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

Filter out ACR metric items from saved ones if feature flag is disabled #9364

Closed
1 task
zutigrm opened this issue Sep 17, 2024 · 8 comments
Closed
1 task
Labels
P1 Medium priority Team S Issues for Squad 1 Type: Feature New feature

Comments

@zutigrm
Copy link
Collaborator

zutigrm commented Sep 17, 2024

Feature Description

We should prevent metric tiles from still appearing in the widget area after the conversionReporting feature flag is disabled.


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

Acceptance criteria

  • After conversionReporting feature flag is disabled key metric tiles that have been already saved and added to the widget area, should not appear, and instead a ghost card should be shown

Implementation Brief

  • Update assets/js/googlesitekit/datastore/user/key-metrics.js
    • Edit getKeyMetrics selector
      • userPickedMetrics and answerBasedMetrics should be filtered out for any saved ACR items, only if conversionReporting feature flag is disabled.
      • You can add a new constant in assets/js/googlesitekit/datastore/user/constants.js for example and map all non-ACR widget slugs in an array, so it can be used for checking against saved metrics for filtering purpose.
      • NON-ACR widgets that can be used to filter out ACR metrics are as follows:
        • KM_ANALYTICS_ADSENSE_TOP_EARNING_CONTENT
        • KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE
        • KM_ANALYTICS_LEAST_ENGAGING_PAGES
        • KM_ANALYTICS_NEW_VISITORS
        • KM_ANALYTICS_POPULAR_AUTHORS
        • KM_ANALYTICS_POPULAR_CONTENT
        • KM_ANALYTICS_POPULAR_PRODUCTS
        • KM_ANALYTICS_RETURNING_VISITORS
        • KM_ANALYTICS_TOP_CATEGORIES
        • KM_ANALYTICS_TOP_CITIES
        • KM_ANALYTICS_TOP_CONVERTING_TRAFFIC_SOURCE
        • KM_ANALYTICS_TOP_COUNTRIES
        • KM_ANALYTICS_TOP_RECENT_TRENDING_PAGES
        • KM_ANALYTICS_TOP_TRAFFIC_SOURCE
        • KM_ANALYTICS_PAGES_PER_VISIT
        • KM_ANALYTICS_VISIT_LENGTH
        • KM_ANALYTICS_TOP_RETURNING_VISITOR_PAGES
        • KM_ANALYTICS_VISITS_PER_VISITOR
        • KM_ANALYTICS_MOST_ENGAGING_PAGES
        • KM_ANALYTICS_TOP_CATEGORIES
        • KM_SEARCH_CONSOLE_POPULAR_KEYWORDS

Test Coverage

  • Update assets/js/googlesitekit/datastore/user/key-metrics.test.js to include this new scenario, where saved ACR widget slug, would not be included in the final array when metrics are retrieved using getKeyMetrics selector, and when feature flag is disabled, and they are included when it is enabled

QA Brief

  • Set up Google Site Kit with the Analytics module enabled / active
  • Reach out to @zutigrm for access to the ACR test site data
  • Set up KMW manually, choose 2 random ones, and save
  • Enable the conversionReporting feature flag
  • Go back to the manual KMW selection panel and choose any of the now present ACR widgets, such as "top cities driving leads", and save the selection
  • Verify that the ACR KMW is showing in the widget rendering area of KMW
  • Now, disable/uncheck the conversionReporting feature flag
  • Navigate back to the main Site Kit dashboard and observe the KMW rendering area
  • The ACR widget(s) should no longer appear, but all others should
  • Re-enable the conversionReporting feature flag and validate that the ACR metric(s) is shown again

Changelog entry

  • Only show Analytics Conversion Reporting items in the dashboard when the feature flag is enabled.
@zutigrm zutigrm added Type: Feature New feature P1 Medium priority labels Sep 17, 2024
@zutigrm zutigrm assigned zutigrm and unassigned zutigrm Sep 17, 2024
@zutigrm zutigrm added the Team S Issues for Squad 1 label Sep 17, 2024
@zutigrm zutigrm assigned zutigrm and unassigned zutigrm Sep 17, 2024
@zutigrm
Copy link
Collaborator Author

zutigrm commented Sep 18, 2024

Since AC is very straightforward, I added both AC and IB and moved it to the IBR

@eugene-manuilov eugene-manuilov self-assigned this Sep 18, 2024
@eugene-manuilov
Copy link
Collaborator

  • userPickedMetrics and answerBasedMetrics should be filtered out for any saved ACR items, only if conversionReporting feature flag is disabled.

@zutigrm let's make it clear which items should be filtered out exactly. Could you please list them in IB?

@zutigrm
Copy link
Collaborator Author

zutigrm commented Sep 19, 2024

@eugene-manuilov Sure, I added the list, and expanded the IB

@zutigrm zutigrm assigned eugene-manuilov and unassigned zutigrm Sep 19, 2024
@eugene-manuilov
Copy link
Collaborator

Thanks, IB ✔️

@10upsimon
Copy link
Collaborator

@zutigrm and I chatted about this via DM, and it made more sense to define a constant that holds non ACR metrics only, and filter against this list. This saves having to add metrics to the array as they become available in code, thus reducing the chance for oversight thereof.

I'll update the IB shortly to reflect this change, cc @eugene-manuilov

@10upsimon
Copy link
Collaborator

@zutigrm @eugene-manuilov the IB has been updated accordingly.

@10upsimon
Copy link
Collaborator

@zutigrm :

Noting that we are not able to add test cases to assets/js/googlesitekit/datastore/user/key-metrics.test.js until such time that we have the mapping defined, as these tests rely on the real values returned by registry.select( CORE_USER ).getAnswerBasedMetrics().

We should make the addition of this test as part of the GH issue that maps ACR metrics to site purpose answers, once that task is defined.

@10upsimon 10upsimon removed their assignment Sep 27, 2024
@zutigrm zutigrm assigned zutigrm and unassigned zutigrm Sep 30, 2024
@tofumatt tofumatt assigned tofumatt and unassigned tofumatt Sep 30, 2024
@mohitwp mohitwp self-assigned this Oct 1, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Oct 2, 2024

QA Update ✅

  • Tested on main environment.
  • Verified after conversionReporting feature flag is disabled key metric tiles that have been already saved and added to the widget area, do not appear, and instead a ghost card shown there.
  • Also, done some additional testing around key metrics widget selection.
Recording.1447.mp4

@mohitwp mohitwp removed their assignment Oct 2, 2024
@tofumatt tofumatt closed this as completed Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Medium priority Team S Issues for Squad 1 Type: Feature New feature
Projects
None yet
Development

No branches or pull requests

5 participants