No "Update" button for the "Most popular products...." key metric when googlesitekit_post_date dimension is not present
Bug Description
Unlike other key metric tiles, which do request a user "Updates" the connection to their Analytics property settings in the case of missing custom dimensions, the "Most popular product by pageviews" tile does not output the expected notice, instead displaying an error.
Image below: The "Most popular products by pageviews" tile, and how it appears if the googlesitekit_post_date custom dimension is removed.
The "Top recent trending tile", which displays an "Update" button when the requires custom dimensions are not present.
This may be REST related however I don't see any REST errors elsewhere on the site, or warnings in my Site Health status. The below is what appears when opening a response :
This was also tested on various hosting platforms, easily reproducible.
Many users have reported this in the support forums, with more details added to https://github.com/google/site-kit-wp/issues/8152. See the steps to recreate and other information below:
Browser Console errors
googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
GET https://wexcraft.com/wp-json/google-site-kit/v1/modules/analytics-4/data/report?metrics%5B0%5D%5Bname%5D=screenPageViews&dimensions%5B0%5D%5Bname%5D=pagePath&startDate=2024-03-08&endDate=2024-03-14&dimensionFilters%5BcustomEvent%3Agooglesitekit_post_type%5D%5BfilterType%5D=stringFilter&dimensionFilters%5BcustomEvent%3Agooglesitekit_post_type%5D%5BmatchType%5D=EXACT&dimensionFilters%5BcustomEvent%3Agooglesitekit_post_type%5D%5Bvalue%5D=product&orderby%5B0%5D%5Bmetric%5D%5BmetricName%5D=screenPageViews&orderby%5B0%5D%5Bdesc%5D=true&limit=3&_locale=user 400 (Bad Request)
O @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
u @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
forEach.e.<computed> @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
n @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:1
_next @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:1
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:1
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:1
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
u @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
a @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
o @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
t @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
u @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
a @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-api-8132eff5850341edf9ce.js:1
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
w @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-api-8132eff5850341edf9ce.js:14
u @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
forEach.e.<computed> @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
n @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:1
_next @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:1
Promise.then (async)
n @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:1
_next @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:1
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:1
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:1
(anonymous) @ googlesitekit-api-8132eff5850341edf9ce.js:14
get @ googlesitekit-api-8132eff5850341edf9ce.js:14
controlCallback @ googlesitekit-modules-analytics-4-ed3d771515499bde79cf.js:74
(anonymous) @ googlesitekit-datastore-site-bc570a41be38ac467383.js:1
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
n @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
t.any @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
n @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
r @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
n @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
t.any @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
n @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
r @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
n @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
a @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
e @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
t.iterator @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
n @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
n @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
a @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
e @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
u @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
forEach.e.<computed> @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
p @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
_next @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
ne @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
u @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
forEach.e.<computed> @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
p @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
_next @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
setTimeout (async)
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
u @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
forEach.e.<computed> @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
p @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
_next @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
l @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
c @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
s @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-modules-analytics-4-ed3d771515499bde79cf.js:62
y @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
a @ googlesitekit-data-40bd8d2e59647cc53f34.js:1
PopularProductsWidget @ googlesitekit-modules-analytics-4-ed3d771515499bde79cf.js:62
Fo @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
ii @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
Ti @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
Qj @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
Kj @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
wa @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
t.unstable_runWithPriority @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
Br @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
Gr @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
Vr @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
Ig @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
Go @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
e @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
o @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
p @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
(anonymous) @ googlesitekit-main-dashboard-983d835bb358eafaea9b.js:72
(anonymous) @ googlesitekit-components-gm2-3b804ce7f2437dac1e19.js:1
MDCComponent.emit @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
notifySelected @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
MDCMenuFoundation.handleItemAction @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
handleItemAction_ @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
MDCComponent.emit @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
notifyAction @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
MDCListFoundation.handleClick @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
MDCList.handleClickEvent_ @ googlesitekit-vendor-e5d6aae7e8fa0fa1a1e3.js:7
googlesitekit-api-8132eff5850341edf9ce.js:14 Google Site Kit API Error method:GET datapoint:report type:modules identifier:analytics-4 error:"Did you mean customEvent:googlesitekit_post_author? Field customEvent:googlesitekit_post_type is not a valid dimension. For a list of valid dimensions and metrics, see https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema "
Network Request
{
"code": 400,
"message": "Did you mean customEvent:googlesitekit_post_author? Field customEvent:googlesitekit_post_type is not a valid dimension. For a list of valid dimensions and metrics, see https:\/\/developers.google.com\/analytics\/devguides\/reporting\/data\/v1\/api-schema ",
"data": {
"status": 400,
"reason": "badRequest"
}
}
Steps to reproduce
- Add the "Most popular products..." key metrics tile to a site (which has WooCommerce added, so there are products post types)
- Visit the associated property from analytics.google.com
- Archive the googlesitekit_post_date custom dimension
- Visit your SK dashboard once more
- There is no option to update, with the only workaround being to remove that tile, save, edit the tiles once more, and add.
Screenshots
- SK 1.122.0
- This has been occurring for users since Key Metrics was enabled (see https://github.com/google/site-kit-wp/issues/8152)
- Internal testing. Happy to share some test sites where this is occurring.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The "Most popular products by pageviews" key metric widget should be updated to behave the same as other tiles that rely on custom dimensions such that when the dimension is not present, it offers a CTA to "Update" the property to create it
Implementation Brief
- [ ] Update
PopularProductsWidgetto usewithCustomDimensionssimilar toPopularAuthorsWidgetorTopCategoriesWidget
Test Coverage
- No changes necessary but would be good to add some minimal coverage to ensure custom dimension infra is being used
QA Brief
Changelog entry
@jimmymadon Assigning this to you to take a look please when you have a moment, as our key metrics expert. :D cc @ivonac4 @aaemnnosttv
IB ✅
QA Update: ⚠️
@kuasha420 I am unable to trigger the error message following the steps in the ticket and also how we would usually generate errors for the KMW tiles. Please could you relook at the QAB, and sggest any additional steps that are required. Were you able to recreate the error states following the instructions?
QA Update ✅
@wpdarren , I synced with @kuasha420 on this and the reason why the error could not be seen and was stuck in gathering state is because after we archive the custom dimension, it takes up to 24 hours for that to take effect.
One workaround for this is to create a new property for Google analytics in the Site Kit GA module.
- We did that and we were able to simulate the production error
- After the error is simulated, we changed to main branch and now the product tile is rightly updated to 'Update', similar to the other tiles.
Main Branch (Retry is updated to Update):
Moving this ticket to Approval.