Skip to content
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

"Most Popular Content" table displaying page titles in different languages since 1.42.0 #4165

Closed
jamesozzie opened this issue Sep 29, 2021 · 23 comments
Labels
Module: Analytics Google Analytics module related issues P1 Medium priority QA: Eng Requires specialized QA by an engineer Rollover Issues which role over to the next sprint Type: Bug Something isn't working Type: Support Support request
Milestone

Comments

@jamesozzie
Copy link
Collaborator

jamesozzie commented Sep 29, 2021

Bug Description

Since the release of 1.42.0 there have been reports of unusual page title tiles in the "Most Popular Content" table. The titles of some pages are in different languages, including Chinese and German. In one users case this is occurring on both of their sites.

These sites don't have language variations of their content, or have any language plugin active.

In a screenshot kindly provided by one user within their SH info it displays this behavior. You'll notice that while the page titles are in a different language within the "Most populate content" table they do seem to match the actual title if the titles were to be translated.

https://wordpress.org/support/topic/most-popular-content-broken-2/#post-14921621 | Open | SH info
https://wordpress.org/support/topic/error-message-translated-page-titles/ | Open | SH info 1 | SH info 2

Screenshots

Additional Context

  • SK 1.42.0
  • This didn't occur previously for one of the impacted users (previous topic | related GH issue)
  • One impacted user confirmed they never had a language plugin active or title variations of their pages

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

Acceptance criteria

  • The page titles report, used in the getPageTitles selector, should sort response rows by page views descending.

Implementation Brief

  • Update the object of options used for the page titles report to include the orderby parameter, which should be an array with a single object:
    • fieldName: 'ga:pageviews'
    • sortOrder: DESCENDING

Test Coverage

  • No changes should be necessary, but it may require some VRT images are updated as a result of this change

QA Brief

  • Verify the getPageTitles() selector sorts page titles by their page views (eg. ga:pageviews) in descending order as per the ACs/IB. There aren't easy steps-to-reproduce this bug here to QA, so this should be sufficient to QA it 🙂

Changelog entry

  • Fix a bug that could cause the page title in the "Most Popular Content" table to appear in an unexpected language
@jamesozzie jamesozzie added Group: Escalation Issues which requires escalation Module: Analytics Google Analytics module related issues Type: Support Support request labels Sep 29, 2021
@jamesozzie
Copy link
Collaborator Author

The same occurs for one impacted user with all plugins deactivated and using a core theme - from a Chrome browser incognito window. Further checks being performed.

@mxbclang
Copy link

Moving to L1; @jamesozzie leaving a note for you in Asana now.

@eugene-manuilov eugene-manuilov self-assigned this Oct 4, 2021
@eugene-manuilov
Copy link
Collaborator

eugene-manuilov commented Oct 4, 2021

Looks like Google Analytics somehow tracks pages translated by Chrome and then we pick this information by accident when we try to aggregate page views by page URLs. I think we can fix it by adding orderby to sort page titles by page views descending. In this case, even if there are records with translated titles, they will be ignored because their page views should be much lower than for the main language.

@eugene-manuilov
Copy link
Collaborator

@aaemnnosttv can you check my AC?

@aaemnnosttv
Copy link
Collaborator

@eugene-manuilov ACs LGTM (I think we were planning on making this change anyways) – were you able to confirm that Google translate is the cause here or are we assuming?

@eugene-manuilov
Copy link
Collaborator

 were you able to confirm that Google translate is the cause here or are we assuming?

@aaemnnosttv unfortunately, I wasn't. That's my best hunch.

@aaemnnosttv
Copy link
Collaborator

Thanks @eugene-manuilov, it sounds reasonable but I'm not sure we should use this as the AC for this issue in particular without knowing that it would solve the problem. Maybe we should do this anyways in a separate issue and follow it here?

Thoughts @felixarntz ?

@felixarntz
Copy link
Member

@aaemnnosttv @eugene-manuilov I think going with this approach here should be fine. As mentioned, that is something we were thinking might be helpful anyway, and I could see how this "bug" is caused by not using any particular sorting. I'd say if this ends up not fixing the problem, we can still reopen the issue or open a follow-up one. IMO, the ACs are good to go.

@felixarntz felixarntz added P1 Medium priority Type: Bug Something isn't working labels Oct 4, 2021
@felixarntz felixarntz removed their assignment Oct 4, 2021
@aaemnnosttv aaemnnosttv removed the Group: Escalation Issues which requires escalation label Oct 4, 2021
@eugene-manuilov
Copy link
Collaborator

IB ✔️

@eugene-manuilov eugene-manuilov removed their assignment Oct 5, 2021
@fhollis fhollis added this to the Sprint 60 milestone Oct 6, 2021
@raja-anbazhagan
Copy link

raja-anbazhagan commented Oct 7, 2021

Looks like Google Analytics somehow tracks pages translated by Chrome and then we pick this information by accident when we try to aggregate page views by page URLs. I think we can fix it by adding orderby to sort page titles by page views descending. In this case, even if there are records with translated titles, they will be ignored because their page views should be much lower than for the main language.

Instead of assuming the page views should be lower for translated pages, can we map the URLs from Google Analytics and map them with the slug from WordPress? We anyways show only the top pages. There shouldn't be any performance hit.

@kuasha420 kuasha420 self-assigned this Oct 19, 2021
@kuasha420
Copy link
Contributor

I am seeing that orderby with the parameters from IB is already implemented in develop here.

orderby: [
{
fieldName: 'ga:pageviews',
sortOrder: 'DESCENDING',
},
],
limit: 10,
};
const report = store.getReport( args );
const pageTitles = store.getPageTitles( report, args );

Did this get implemented as part of another issue or am I missing something here?

cc @aaemnnosttv @eugene-manuilov

@aaemnnosttv
Copy link
Collaborator

@kuasha420 this issue is about making a change to the getPageTitles selector which makes a separate call to getReport internally which is different than the main report it's called with.
See

getPageTitles: createRegistrySelector(

@eugene-manuilov
Copy link
Collaborator

@kuasha420, we forgot to mention it in IB that report arguments need to be updated in storybook stories too. Please, update the following report arguments:

{
startDate: '2020-08-13',
endDate: '2020-09-09',
dimensionFilters: {
'ga:pagePath': new Array( 10 )
.fill( '' )
.map( ( _, i ) => `/test-post-${ i + 1 }/` )
.sort(),
},
dimensions: [ 'ga:pagePath', 'ga:pageTitle' ],
metrics: [ { expression: 'ga:pageviews', alias: 'Pageviews' } ],
limit: 50,
},

{
startDate: '2020-12-09',
endDate: '2021-01-05',
dimensionFilters: {
'ga:pagePath': new Array( 10 )
.fill( '' )
.map( ( _, i ) => `/test-post-${ i + 1 }/` )
.sort(),
},
dimensions: [ 'ga:pagePath', 'ga:pageTitle' ],
metrics: [ { expression: 'ga:pageviews', alias: 'Pageviews' } ],
limit: 50,
},

@kuasha420
Copy link
Contributor

Thank you both for the clarification. <3 @eugene-manuilov @aaemnnosttv

@kuasha420
Copy link
Contributor

@aaemnnosttv @eugene-manuilov not sure what to put in QA Brief for this one. Any help will be appreciated.

@kuasha420 kuasha420 removed their assignment Oct 19, 2021
@tofumatt tofumatt self-assigned this Oct 20, 2021
@tofumatt tofumatt added the QA: Eng Requires specialized QA by an engineer label Oct 20, 2021
@tofumatt
Copy link
Collaborator

@kuasha420 Given there aren't clear steps-to-reproduce here I think it's fine to mark this one as QA:Eng and have the QA steps be to verify the implementation. It's not ideal but I think it's fine for this one 🙂

I added a simple QA brief and the QA: Eng label 👍🏻

@tofumatt tofumatt assigned kuasha420 and unassigned tofumatt Oct 21, 2021
@kuasha420 kuasha420 assigned tofumatt and unassigned kuasha420 Oct 21, 2021
@tofumatt tofumatt removed their assignment Oct 21, 2021
@fhollis fhollis modified the milestones: Sprint 60, Sprint 61 Oct 25, 2021
@fhollis fhollis added the Rollover Issues which role over to the next sprint label Oct 25, 2021
@ivankruchkoff ivankruchkoff self-assigned this Oct 28, 2021
@ivankruchkoff
Copy link
Contributor

QA✅
Sorted by views descending, I can confirm the following args in the request.

orderby: [
  { fieldName: 'ga:pageviews', sortOrder: 'DESCENDING' },
]

I don't see unusual page titles, but when I checked versions 1.41 and 1.42, I also didn't see them.

@ivankruchkoff ivankruchkoff removed their assignment Oct 28, 2021
@raja-anbazhagan
Copy link

I'm at 1.44.0 and I'm still seeing Spanish titles for my pages on English.

@jamesozzie
Copy link
Collaborator Author

@raja-anbazhagan We'll have the latest version of Site Kit released early next week. This fix will be part of that release so hopefully you'll not longer encounter this behavior at that point. Be sure to let us know the outcome once you test it!

@raja-anbazhagan
Copy link

@jamesozzie I misread the update from @ivankruchkoff. Is there a snapshot version available for me to test?

@mxbclang
Copy link

mxbclang commented Nov 5, 2021

@raja-anbazhagan We do not offer pre-release testing versions, but as @jamesozzie noted, this will likely be released on Monday. If you're still having trouble after updating, please open a new support topic on our support forum and we'd be happy to take another look – all support for Site Kit is provided there on the forums. Thank you!

@jamesozzie
Copy link
Collaborator Author

@raja-anbazhagan Just to let you know that Site Kit 1.45.0 has been released. Can you give that a try and confirm that the most popular content table works as expected with these latest changes?

@raja-anbazhagan
Copy link

@jamesozzie Works perfectly. Thanks.

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 P1 Medium priority QA: Eng Requires specialized QA by an engineer Rollover Issues which role over to the next sprint Type: Bug Something isn't working Type: Support Support request
Projects
None yet
Development

No branches or pull requests

10 participants