google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.25k stars 291 forks source link

No "Update" button for the "Most popular products...." key metric when googlesitekit_post_date dimension is not present #8402

Closed jamesozzie closed 5 months ago

jamesozzie commented 7 months ago

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._ image

The "Top recent trending tile", which displays an "Update" button when the requires custom dimensions are not present.

image

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 :

image

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 ![image](https://github.com/google/site-kit-wp/assets/41326532/f2233635-0bab-480c-8aa3-2530fcc990e7) ``` 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. @ 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. @ 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. @ 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. @ 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. @ 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 ![image](https://github.com/google/site-kit-wp/assets/41326532/45fdbf3b-83a0-4b1d-a67b-e11db297c389) ``` { "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

  1. Add the "Most popular products..." key metrics tile to a site (which has WooCommerce added, so there are products post types)
  2. Visit the associated property from analytics.google.com
  3. Archive the googlesitekit_post_date custom dimension
  4. Visit your SK dashboard once more
  5. There is no option to update, with the only workaround being to remove that tile, save, edit the tiles once more, and add.

Screenshots

image


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

Acceptance criteria

Implementation Brief

Test Coverage

QA Brief

Changelog entry

mxbclang commented 7 months ago

@jimmymadon Assigning this to you to take a look please when you have a moment, as our key metrics expert. :D cc @ivonac4 @aaemnnosttv

tofumatt commented 7 months ago

IB ✅

wpdarren commented 5 months ago

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?

kelvinballoo commented 5 months ago

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.

Latest Release (Production error) showing 'Retry' button Screenshot 2024-05-15 at 20 16 18 Main Branch (Retry is updated to Update): Screenshot 2024-05-15 at 20 16 34

Moving this ticket to Approval.