Repository navigation
feat(vtex): expose the search id on the listing page - #19
Merged
Merged
Conversation
Intelligent Search answers every product search with a searchId, and VTEX's search analytics (Activity Flow) want it reported back verbatim on impressions and clicks. The loader dropped it; it now travels on pageInfo.searchId. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
O que é
O loader
vtex/loaders/intelligentSearch/productListingPage.tspassa a devolver osearchIdque o Intelligent Search manda em toda resposta deproduct_search, empageInfo.searchId.Por que
O VTEX Activity Flow (search analytics) exige esse id, sem alteração, em cada impressão e clique de resultado de busca (doc). O loader descartava o campo, então o site não tinha como marcar a busca. Consumidor: deco-sites/oficina-reserva#838.
O que muda
commerce/types.ts:PageInfo.searchId?: string.vtex/utils/types.ts:ProductSearchResult.searchId?: string.undefined.Campo opcional e aditivo: quem não lê não muda. O id é determinístico por consulta (duas chamadas iguais à API devolvem o mesmo), então o cache do loader não o falsifica.
Validado
Com o site apontando para esta branch em localhost:
/live/invokedevolve ids distintos para página 1 e 2 da mesma busca, iguais em chamadas repetidas.🤖 Generated with Claude Code