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.23k stars 286 forks source link

Create the "Most popular products by pageviews" key metric widget tile #6249

Closed jimmymadon closed 1 year ago

jimmymadon commented 1 year ago

Feature Description

Screenshot 2022-12-19 at 01 38 07

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

tofumatt commented 1 year ago

ACs are good here, moving to IB 👍🏻

derweili commented 1 year ago

After talking with @aaemnnosttv and @jimmymadon we decided to solve the  Filter only those pages which have “product” as the post type. requirement by looking for the products base path (e.g. /product*/) and using this base path as a dimensions filter in the getReports.

derweili commented 1 year ago

Set the Estimate to 30. We are making use of dimensionsFilter here for the first time, so I think this may take a bit longer as there are probably some challenges to overcome which we don't know yet.

tofumatt commented 1 year ago

What's the thinking in using the 'product' post type? I assume it's a default for WooCommerce, but there's nothing mentioning it by name here and the whole "product" post type feels a bit arbitrary here. Like I'm just not sure why we're picking that specific one and what plugins I should expect this to work with here. I didn't see any mention of this in the design doc or PRD either, so I'm just a bit unclear as to what this is expected to work with.

It'd be helpful to know that here, because otherwise this feels a bit disjointed in terms of the actual use-case and how we would test this out, even in development.

I see @derweili wrote the IB here but I know he won't be around to answer right away, so I'm assigning this to @jimmymadon as you wrote the ACs here and also the design doc.


I think otherwise this looks good, but it just feels a bit abstract right now and I think it'd be worth clarifying things, possibly in the ACs as well, before moving this into the backlog.

Sorry for not catching that in the ACs, to be fair. 😓

aaemnnosttv commented 1 year ago

What's the thinking in using the 'product' post type?

@tofumatt It is mentioned in the PRD where the metrics are listed.

However, given that a site may have products/ecommerce without using CPTs, I agree that it won't always make sense to look for a product post type. A post type is something we can look at on the backend though to analyze its permalink structure in order to identify its prefix (assuming the site is even using pretty permalinks! Most do). The PRD also goes on to provide a fallback, if we can't determine what a product is.

Ultimately, we need to identify something we can use in the Analytics query to filter with and that limits us to find something in the path. Ideally, we could provide the post type to Analytics as a custom dimension but that probably isn't something we can safely do (worth looking into as a future enhancement though).

The implementation should be flexible so that it isn't specific to a plugin or post type but it's reasonable to use something generic as a starting point. From this perspective, perhaps maybe we should use a /product/ URL prefix segment (which could be filterable to support multiple) and would be decoupled from what type it relates to?

cc @marrrmarrr @felixarntz

tofumatt commented 1 year ago

I noticed it mentioned in the PRD—I was actually asking where that came from, sorry that wasn't clear. My thinking was the PRD seems to assume that 'products' as a post type always assumes ecommerce, and also doesn't cover any other Custom Post Type being the product a user would want to measure on their site.

If we're looking to start with something very generic I suppose these URLs and CPTs are something, but they just seem to invite a lot of confusion and support requests around the many cases I can see them not working.

Just from my own experience shopping on WordPress/WooCommerce sites, it does seem that /product/ is a common URL prefix—I'm guessing it's the default. That could be a good starting point, but I wonder if we should add a note/info text to this widget stating where the data comes from? Just to pre-empt any confusion around the data it's fetching.

What do you think about adding a little "Info" note or "Learn more" link here to a help doc explaining how we determine products here, @aaemnnosttv/@felixarntz/@marrrmarrr?

jimmymadon commented 1 year ago

@tofumatt We discussed this on our AC Sync on 15/05/2023 and for now, the ACs and IB seem to be ok. In future iterations, we could provide a list of post types or URL segments for products.

What do you think about adding a little "Info" note or "Learn more" link here to a help doc explaining how we determine products here?

We think this is a good idea - I have created #7060 for this purpose.

UPDATE: Assigned this back to you so you can have another pass and move this forward.

tofumatt commented 1 year ago

@jimmymadon Sounds good, I think it's a good start too. Thanks for the follow-up issue as well 😄

IB ✅

aaemnnosttv commented 1 year ago

One thing I noticed while testing here is that for a site with WooCommerce but no products that have been recorded in GA, it shows as if GA is in a gathering state. We may want to modify the wording here to be more clear.

image
wpdarren commented 1 year ago

QA Update: ⚠️

@jimmymadon I have two questions:

  1. The links on other tiles point to Analytics, but this one points to the post. Is that expected?
  2. As Evan mentioned above, if you have no products (but WooCommerce installed) the message is confusing. Feel it should say that you do not have any products, or, something along those lines. What do you think?
jimmymadon commented 1 year ago

@wpdarren

  1. Yes - the popular content widget on the dashboard also links to Analytics. So while this is not clear from Figma or the AC, we should link to analytics.
  2. Yes - I believe such a website will not have "other pages" - so falling back on to the popular content widget is not a good idea here anyways. We can simply have a message that says "Your site doesn't have any products."

c.c. @marrrmarrr Does the above sound good to you?

marrrmarrr commented 1 year ago

@jimmymadon this SG, I'd just slightly change the message to say "Site Kit hasn't detected any products on your site yet"

aaemnnosttv commented 1 year ago

The links on other tiles point to Analytics, but this one points to the post. Is that expected?

Yes - the popular content widget on the dashboard also links to Analytics. So while this is not clear from Figma or the AC, we should link to analytics.

We should link to Analytics.

if you have no products (but WooCommerce installed) the message is confusing. Feel it should say that you do not have any products, or, something along those lines. What do you think?

Yes - I believe such a website will not have "other pages" - so falling back on to the popular content widget is not a good idea here anyways. We can simply have a message that says "Your site doesn't have any products."

Regarding the wording here, I think it's important to note that this is based on nothing coming back from GA – we shouldn't make statements about there being no products on the site. It would be more accurate to say that we're "gathering data for products" or something like that. I'll defer to @marrrmarrr for the language to use but there's a key distinction to make that should help avoid confusion while remaining accurate if someone just added WC to their site or hasn't added any products yet, or products don't have any GA pageviews measured yet for whatever other reason 😄

marrrmarrr commented 1 year ago

@aaemnnosttv "gathering data" seems to imply that there are products and the user should just wait a bit to see the data, whereas in fact there is no data in GA (whether there are products or not, it seems like we can't establish with absolute certainty). So I'd suggest something like "Analytics has no data yet for products on your site" or similar.

aaemnnosttv commented 1 year ago

Back to you for another pass @wpdarren 👍

wpdarren commented 1 year ago

QA Update: ⚠️

@jimmymadon an observation I would like to share with you.

I answered the user input questions and selected Sell products or services for question 1. I had installed WooCommerce and also added the /en/why-%product%/ permalink as per the QAB.

According to the QAB:

Then disable the Woocommerce plugin and go back to the dashboard page. You should not see the widget anymore.

When the site has products this worked as expected, but when the site doesn't have any products the tile still appears when you disable WooCommerce. Is this expected?

wpdarren commented 1 year ago

QA Update ✅

Update on my comment above. I have had a conversation with @jimmymadon about this on Slack and we have agreed that a ticket needs to be created for the scenario I mention above where for a site that has no products, the tile does not disappear when WooCommerce (or any product post type) is disabled. Jimmy is going to create a ticket, and then it will be added to the bug bash board as a known issue. We need to think about the best way to implement this and don't have to do that now.

Verified:

Screenshots ![image](https://github.com/google/site-kit-wp/assets/73545194/7200d6af-25b8-44b4-970c-0fa11fc658b0) ![image](https://github.com/google/site-kit-wp/assets/73545194/e28e3ca2-6ef7-4dbb-b46a-560ffb3e3ceb) ![image](https://github.com/google/site-kit-wp/assets/73545194/fa8e92e9-882c-474d-8932-be6be4c30f46)