-
Notifications
You must be signed in to change notification settings - Fork 284
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 support for querying Analytics reports with dimension filters #2421
Labels
Module: Analytics
Google Analytics module related issues
P0
High priority
QA: Eng
Requires specialized QA by an engineer
Rollover
Issues which role over to the next sprint
Type: Enhancement
Improvement of an existing feature
Milestone
Comments
felixarntz
added
P0
High priority
Type: Enhancement
Improvement of an existing feature
QA: Eng
Requires specialized QA by an engineer
Next Up
Module: Analytics
Google Analytics module related issues
labels
Nov 24, 2020
IB ✅ |
7 tasks
@felixarntz CR ✅ |
Resolved MR issues, back to you @felixarntz. |
QA ✔️ All looks good. Dimension filters work as expected. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Module: Analytics
Google Analytics module related issues
P0
High priority
QA: Eng
Requires specialized QA by an engineer
Rollover
Issues which role over to the next sprint
Type: Enhancement
Improvement of an existing feature
Currently it is not possible to use dimension filters when requesting an Analytics report. This should be implemented as it is needed for the new Analytics All Traffic widget (see #2420).
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
GET:report
datapoint in the Analytics class should be expanded to support an optionaldimensionFilters
argument:dimensionName => dimensionValue
pairs. They should then be parsed into the necessaryGoogle_Service_AnalyticsReporting_DimensionFilter
(see also https://developers.google.com/analytics/devguides/reporting/core/v4/rest/v4/reports/batchGet#DimensionFilter) structure required for the Google API request internally, with operatorEXACT
. All entries in the map should then be added as a newGoogle_Service_AnalyticsReporting_DimensionFilterClause
(see also https://developers.google.com/analytics/devguides/reporting/core/v4/rest/v4/reports/batchGet#DimensionFilterClause), with operatorAND
.page
query parameter (seeAnalytics::create_analytics_site_data_request
).getReport
selector of themodules/analytics
datastore should be enhanced accordingly, so that the newdimensionFilters
argument is supported. The argument should also be documented as one of the selector'soptions
.Implementation Brief
Google\Site_Kit\Modules\Analytics
class:$data['dimensionFilters']
isn't empty the handler for theGET:report
endpoint and copy over its values into the appropriatedimensionFilters
property of the$request_args
variable. Please, make sure you to filter out dimensions that are not listed in the$request_args['dimensions']
array;create_analytics_site_data_request
method to populate dimension filters if$args['dimensionFilters']
property isn't empty. See AC for additional details.assets/js/modules/analytics/datastore/report.js
file:dimensionFilters
validator to thevalidateParams
function of thefetchGetReportStore
store. It should check whetherdimensionFilters
is a map of dimension names and values and all dimension names are also defined in thedimensions
option.getReport
selector to listdimensionFilters
argument of the options paramter.Test Coverage
Visual Regression Changes
QA Brief
GET:report
endpoint in the Analytics class and make sure it processes dimension filters correctly.Changelog entry
dimensionFilters
argument to the AnalyticsGET:report
REST datapoint in PHP and thegetReport
selector in JS.The text was updated successfully, but these errors were encountered: