Skip to content

feat: We only need to analyze top 3 pages for PLG customers#2120

Merged
tkotthakota-adobe merged 7 commits intomainfrom
SITES-42676
Apr 8, 2026
Merged

feat: We only need to analyze top 3 pages for PLG customers#2120
tkotthakota-adobe merged 7 commits intomainfrom
SITES-42676

Conversation

@tkotthakota-adobe
Copy link
Copy Markdown
Contributor

@tkotthakota-adobe tkotthakota-adobe commented Apr 3, 2026

https://jira.corp.adobe.com/browse/SITES-42676
https://jira.corp.adobe.com/browse/SITES-42074

Summary:

When a request comes from the Sites Optimizer UI (x-client-type: sites-optimizer-ui header) and the site has the summit-plg handler enabled, CWV opportunity suggestions are limited to the top 3 entries. Since the audit-worker stores suggestions sorted by page views descending, this returns the 3 highest-traffic pages with failing metrics.
We also need to consider confidence score to when sorting top 3 (SITES-42074)

All other clients (reporting, API consumers without the header) receive the full suggestion list unchanged.

Tests:

  1. PLG site only shows top 3 pages on ASO UI for CWV: https://sunstargum.com/ (SiteId: d2960efd-a226-4b15-b5ec-b64ccb99995e)
image
  1. PGS sites shows all suggestions before the fix for https://corporate.walmart.com/
image

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@ramboz ramboz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

This PR will trigger no release when merged.

Copy link
Copy Markdown
Contributor

@sandsinh sandsinh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tkotthakota-adobe This is not in alignment with the token architecture that we implemented. The limits are already getting applied for summit-plg customers and grantedEntities are getting filtered. Please add the pageview sort function here - https://github.com/adobe/spacecat-api-service/blob/main/src/support/grant-suggestions-handler.js#L100 and all limits should automatically apply to cwv.

@tkotthakota-adobe
Copy link
Copy Markdown
Contributor Author

tkotthakota-adobe commented Apr 6, 2026

@tkotthakota-adobe This is not in alignment with the token architecture that we implemented. The limits are already getting applied for summit-plg customers and grantedEntities are getting filtered. Please add the pageview sort function here - https://github.com/adobe/spacecat-api-service/blob/main/src/support/grant-suggestions-handler.js#L100 and all limits should automatically apply to cwv.

@sandsinh Can you point me to the PR? Note that these limits only applied to ASO UI display. Ticket: https://jira.corp.adobe.com/browse/SITES-42676

@tkotthakota-adobe
Copy link
Copy Markdown
Contributor Author

@sandsinh I see more than top 3 pages listed under CWV for few sites on prod and dev. Can you fix this as I understand it was implemented part of token architecture feature to show only top 3 pages? Note that we need to have top 3 pages (not just any 3 pages) for cwv summit-plg customers (probably it applies to other opportunities as well). If this requires more work, unblock us by approving this PR: #2120 This is needed for summit (code freeze is this weekend).

Some of the summit-plg sites I checked here:

prod:
605f319f-bc4a-4196-89c3-3478154c3dbb
d52c00bf-baa5-4b17-ac52-8434a5f24ee6

Dev:
155abf9c-976f-4f3f-a7fa-2a06d45d5fa7 (edited) 
[6:30 PM]I ran cwv audit on dev site it still shows more than top 3.

@tkotthakota-adobe tkotthakota-adobe merged commit 8a66638 into main Apr 8, 2026
60 checks passed
@tkotthakota-adobe tkotthakota-adobe deleted the SITES-42676 branch April 8, 2026 18:48
solaris007 pushed a commit that referenced this pull request Apr 8, 2026
# [1.425.0](v1.424.0...v1.425.0) (2026-04-08)

### Bug Fixes

* **deps:** update adobe fixes ([#2159](#2159)) ([5bc0f59](5bc0f59))

### Features

* We only need to analyze top 3 pages for PLG customers ([#2120](#2120)) ([8a66638](8a66638))
@solaris007
Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.425.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants