-
Notifications
You must be signed in to change notification settings - Fork 330
Description
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
- Pivot Report requests infrastructure added in Add Analytics pivot report support to the plugin. #8811 is removed from the codebase
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.phpincludes/Modules/Analytics_4/Report/PivotRequest.phpassets/js/modules/analytics-4/datastore/pivot-report.jsassets/js/modules/analytics-4/datastore/pivot-report.test.jsassets/js/modules/analytics-4/utils/report-pivots-validation.jsassets/js/modules/analytics-4/utils/report-pivots-validation.test.jsassets/js/modules/analytics-4/datastore/__fixtures__/pivot-report.jsonassets/js/modules/analytics-4/utils/__fixtures__/mocked-pivot-report.jsonassets/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 increate_data_request()` method - Remove
pivot-reportcase inparse_data_response()method
- Remove datapoint definition:
-
Remove usage of
Google_Service_AnalyticsData_RunPivotReportRequestfromincludes/Modules/Analytics_4/Report/RequestHelpers.phpandPivotReportfrom 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
isValidPivotsObjectif it's only used by pivot reports
- Remove the
-
Update
assets/js/modules/analytics-4/utils/data-mock.js- Remove
getAnalytics4MockPivotResponse()function - Remove
provideAnalytics4MockPivotReport()function - Remove any pivot-related helper functions like
createPivotDimensionCombinations()andsortPivotRows() - Remove import of
isValidPivotsObjectif it's only used by pivot reports
- Remove
-
Remove the comment
* TODO: This will be refactored to use pivot reports in #8484. -
Remove comment
Lines 58 to 60 in 7e89784
// 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
Lines 64 to 65 in 7e89784
// 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_reportmethodcase "/v1beta/properties/$property_id:runPivotReport"case fromcreate_fake_http_handlermethod'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.