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

[For release in March 2025]: Update filtering of (not set) values in reportRowsWithSetValues and UserDimensionsPieChart to check for blank values #10143

Open
3 tasks
ankitrox opened this issue Jan 30, 2025 · 2 comments

Comments

@ankitrox
Copy link
Collaborator

ankitrox commented Jan 30, 2025

Feature Description

From a recent notice about upcoming changes to the Data API

The Google Analytics Data API is changing the way empty fields are treated in reports.

Today, for fields where Google Analytics doesn’t receive any data, the value (not set) is returned in a report. The Google Analytics Data API will return blank values instead of (not set), beginning in March 2025.

Action Required:

Google Analytics Data API users that are pulling reporting data with filters comparing against the (not set) value will need to update their filtering conditions to compare against a blank value using the EmptyFilter filter type.
If you don’t take action, your reports may show incorrect or empty results.

See also: #10059, #10177.


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

Acceptance criteria

  • JS-side filtering for '(not set)' report values (as opposed to filtering via dimension filters in report options), should be updated to filter for empty values instead.
  • The release of this update should be timed to coincide with the change to the Analytics Data API in March 2025 as per the Feature Description.

Implementation Brief

  • In assets/js/modules/analytics-4/utils/report-rows-with-set-values.js

    • Update reportRowsWithSetValues function to also filter out the blank value '' along with (not set).
      export function reportRowsWithSetValues( rows, maxRows = 3 ) {
      const rowsWithSetValues = rows.filter(
      ( { dimensionValues } ) => dimensionValues[ 0 ].value !== '(not set)'
      );
      return rowsWithSetValues.slice( 0, maxRows );
      }
  • In assets/js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/UserDimensionsPieChart.js

  • reportRowsWithSetValues function is being used by following components, so make sure that correct number of rows are being fetched and passed.

Test Coverage

  • Expand tests for reportRowsWithSetValues to also account for blank values.
  • Fix any failing tests and stories.

Test Coverage

QA Brief

Changelog entry

@ankitrox ankitrox changed the title Update filtering of (not set) values to check for blank value instead Update filtering of (not set) values in reportRowsWithSetValues and UserDimensionsPieChart to check for blank values Jan 30, 2025
@techanvil techanvil changed the title Update filtering of (not set) values in reportRowsWithSetValues and UserDimensionsPieChart to check for blank values March 2025: Update filtering of (not set) values in reportRowsWithSetValues and UserDimensionsPieChart to check for blank values Feb 5, 2025
@techanvil techanvil self-assigned this Feb 5, 2025
@techanvil techanvil changed the title March 2025: Update filtering of (not set) values in reportRowsWithSetValues and UserDimensionsPieChart to check for blank values [For release in March 2025]: Update filtering of (not set) values in reportRowsWithSetValues and UserDimensionsPieChart to check for blank values Feb 5, 2025
@techanvil techanvil assigned ankitrox and unassigned techanvil Feb 5, 2025
@techanvil
Copy link
Collaborator

Hey @ankitrox, thanks for creating this issue.

The initial AC you provided was more on the way to being an IB, so I've provided a new set of AC and moved your version to the IB section.

Seeing as you've got the context on this, it would probably make sense for you to continue to flesh out the IB so I've assigned it back to you in IB, of course please feel free to unassign it if you don't have capacity.

@ankitrox ankitrox removed their assignment Feb 21, 2025
@ankitrox
Copy link
Collaborator Author

Thank you @techanvil for updating the acceptance criteria.

I have updated the IB section as per the required actions for this change and also updated test coverage section.

Moving this to IBR and unassigned myself so that anyone who has bandwidth can pick this for review.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants