fix: use route.params.term as fallback for seller page sponsored products#759
Closed
brenonovelli wants to merge 3 commits into
Closed
fix: use route.params.term as fallback for seller page sponsored products#759brenonovelli wants to merge 3 commits into
brenonovelli wants to merge 3 commits into
Conversation
Contributor
|
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
…er pages On seller pages (map=sellerName, map=seller), fullText is undefined because the seller name is encoded as a facet filter, not a full-text search term. This caused useAds to send context: "home" to the ad server instead of context: "search", returning unrelated sponsored products. Adds route.params.term as a fallback so seller pages correctly pass the seller name as the search term. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
52f612d to
1402827
Compare
…tLayout test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hiagolcm
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SearchResultLayoutnow readsroute.params.termviauseRuntime()as a fallback whensearchQuery.variables.fullTextisundefinedcontext: "home"on seller pages (map=sellerName,map=seller)specs/seller-page-sponsored-products-term.mdRoot cause
On seller pages, the seller name is encoded as a facet filter — not a full-text search term — so
fullTextis alwaysundefined. The@vtex/ads-coreSDK defaults tocontext: "home"when notermis provided, causing unrelated sponsored products to be returned.The correct term is already available in
route.params.termfrom the runtime, but was not being read.Test plan
map=sellerName): sponsored products request sendscontext: "search"+term: "ofertec"map=seller): sponsored products request sendscontext: "search"+term: "shpseller382"fullTexttakes precedence overroute.params.termtermisundefinedwhen neither is availableRelated
ADSUP-295 — [Shopstar] Comportamento de página sem contexto em chamadas
🤖 Generated with Claude Code