Skip to content

Remove Pivot Reporting infrastructure #10298

@benbowler

Description

@benbowler

Feature Description

The ability to make Pivot Report requests to the GA Data API was added in #8811 for the Audience Segmentation feature. However this was not fit for purpose and was not used while being left in the code base.

This additional code adds un-needed complexity and should be removed.


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

Acceptance criteria

Implementation Brief

Note for the IB writer, the majority of this work is in this PR which can be used as a base as to what needs to be reverted.

  • Remove following files and their usage:

    • includes/Modules/Analytics_4/PivotReport.php
    • includes/Modules/Analytics_4/Report/PivotRequest.php
    • assets/js/modules/analytics-4/datastore/pivot-report.js
    • assets/js/modules/analytics-4/datastore/pivot-report.test.js
    • assets/js/modules/analytics-4/utils/report-pivots-validation.js
    • assets/js/modules/analytics-4/utils/report-pivots-validation.test.js
    • assets/js/modules/analytics-4/datastore/__fixtures__/pivot-report.json
    • assets/js/modules/analytics-4/utils/__fixtures__/mocked-pivot-report.json
    • assets/js/modules/analytics-4/utils/__fixtures__/mocked-pivot-report-3-dimensions.json
  • Update includes/Modules/Analytics_4.php

    • Remove datapoint definition: GET:pivot-report => array( 'service' => 'analyticsdata', 'shareable' => true )
    • Remove the entire case GET:pivot-report': block in create_data_request()` method
    • Remove pivot-report case in parse_data_response() method
  • Remove usage of Google_Service_AnalyticsData_RunPivotReportRequest from includes/Modules/Analytics_4/Report/RequestHelpers.php and PivotReport from comments ... shared use between Report and PivotReport. which occurs in several places

  • Update assets/js/modules/analytics-4/utils/validation.js

    • Remove the validatePivotReport() function
    • Remove import of isValidPivotsObject if it's only used by pivot reports
  • Update assets/js/modules/analytics-4/utils/data-mock.js

    • Remove getAnalytics4MockPivotResponse() function
    • Remove provideAnalytics4MockPivotReport() function
    • Remove any pivot-related helper functions like createPivotDimensionCombinations() and sortPivotRows()
    • Remove import of isValidPivotsObject if it's only used by pivot reports
  • Remove the comment

    * TODO: This will be refactored to use pivot reports in #8484.

  • Remove comment

    // TODO: as part of #8484 the report props should be updated to expect
    // the full report rows for the current tile to reduce data manipulation
    // in AudienceTiles.

  • Remove comment

    // TODO: As part of #8484, update these stories to use the data-mock
    // functions to provide report data rather than hardcoding props.

Test Coverage

  • Remove pivot report test methods in tests/phpunit/integration/Modules/Analytics_4Test.php:
    • test_get_pivot_report method
    • case "/v1beta/properties/$property_id:runPivotReport" case from create_fake_http_handler method
    • 'pivot-report' from the arrays

QA Brief

  • Smoke test reporting functionality (eg. reports from a connect Analytics module) throughout the Site Kit plugin.

Changelog entry

  • Remove support for Analytics Pivot reports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Low priorityTeam SIssues for Squad 1Type: InfrastructureEngineering infrastructure & tooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions