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

MWPW-162839: Move title-append to loadArea #3341

Open
wants to merge 8 commits into
base: stage
Choose a base branch
from

Conversation

hparra
Copy link
Contributor

@hparra hparra commented Dec 9, 2024

We increase likelihood that googlebot sees a title modified by title-append by reducing time to modification. We do this by moving logic for title-append into utils.js and executing it as part of loadArea. Resolves: MWPW-162839.

Problem

The title-append feature is an easy way for authors to append a common string to multiple page title tags using bulk metadata, saving considerable authoring hours: https://milo.adobe.com/docs/authoring/features/title-append

While working correctly for users, the primary consumer of this feature are web crawlers, e.g. googlebot. We are seeing inconsistency in title seen by google crawls (UrlInspection) and in SERPs. Team has demonstrated that for all pages that use this feature only a minor fraction of them are indexed as such, e.g. "20% for UK/AU and 10% for FR/DE". (Source: BrightEdge)

While problem may be more complicated, we've noticed pages that load quickly are less likely to show the appended title in UrlInspection or SERPs. Hypothesis is that googlebot moves on before seeing updated page title because it is currently executing late in milo load process via documentPostSectionLoading.

More pages across clouds are using this feature, and it should work as expected.

Solution

Page title is similar to canonical and .html extension in that is significantly affects SERPs, so it makes sense to group similar code together.

We move function into libs/utils/util.js and call it in loadArea right after appendHtmlToCanonicalUrl:

appendHtmlToCanonicalUrl();
This guarantees the title is updated early and eliminates this possibility for inconsistency.

Testing

Unit

Existing utils.js test improved.

E2E

If you open test urls in a new window with full-sized tabs, you can visually see the appended title in the tabs. Notice the significant difference in speed between before and after versions. Before takes several seconds while After is instant.

Test URLs:

Performance

A net 10 lines or 0.46 KB (uncompressed) were added to utils.js. See MWPW-162839 for evidence that even a recent addition of 2.2 KB did not affect P95 for file download speed.

Copy link
Contributor

aem-code-sync bot commented Dec 9, 2024

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.48%. Comparing base (6b2d5c6) to head (94f0ff4).
Report is 2 commits behind head on stage.

Additional details and impacted files
@@            Coverage Diff             @@
##            stage    #3341      +/-   ##
==========================================
- Coverage   96.48%   96.48%   -0.01%     
==========================================
  Files         254      253       -1     
  Lines       59031    59029       -2     
==========================================
- Hits        56955    56953       -2     
  Misses       2076     2076              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hparra hparra marked this pull request as ready for review December 10, 2024 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants