fix: Make autocomplete sponsored ads opt-in instead of always-on - #244
Open
amandascm wants to merge 1 commit into
Open
fix: Make autocomplete sponsored ads opt-in instead of always-on#244amandascm wants to merge 1 commit into
amandascm wants to merge 1 commit into
Conversation
`showSponsored`/`sponsoredCount` were hardcoded to `true`/`2` in Autocomplete#updateProducts, so any VTEX account linked to an ads publisher via PAI started showing sponsored products in the native autocomplete with no way to opt out per environment. Both are now block props (default `false`/`2`) so each store theme/workspace controls ads independently. Co-Authored-By: Claude Sonnet 5 <[email protected]>
|
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.
|
|
Beep boop 🤖 Thank you so much for keeping our documentation up-to-date ❤️ |
chrsmutti
approved these changes
Aug 20, 2026
chrsmutti
left a comment
Contributor
There was a problem hiding this comment.
LGTM!
Wouldn't this change the already running accounts? Is it something for us to worry about?
julia-rabello
approved these changes
Sep 1, 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
Autocomplete#updateProductshardcodedshowSponsored: true/sponsoredCount: 2when callingBiggyClient.suggestionProducts. Any VTEX account linked to an ads publisher via PAI would start showing sponsored products in the native autocomplete, in any workspace (dev or prod), with no way to opt out.showSponsoredandsponsoredCountare now optional props on theautocomplete-result-list.v2block, defaulting tofalse/2. Ads are now opt-in per block declaration, so each store theme/workspace controls whether sponsored products are requested — consistent with how other optional props (hideUnavailableItems,orderBy, ...) already work on this component.docs/Autocomplete.mdand added aCHANGELOG.mdentry under[Unreleased].Context
Root-caused after sponsored products appeared unexpectedly in the Auchan production store. The account had been linked to a publisher via PAI, and since the account↔publisher mapping isn't scoped by VTEX environment, ads could turn on in dev or prod as soon as that link exists — regardless of intent.
Test plan
Cypress(vtex/search-testsagainst thebiggyaccount) passes.lintworkflow (vtex/action-lint) passes.showSponsoredprop set onautocomplete-result-list.v2, noadvertisementOptions.showSponsoredis sent astruetosuggestionProducts."showSponsored": true(and optionally"sponsoredCount") on the block re-enables sponsored products as before.🤖 Generated with Claude Code