Repository navigation
feat(tracking): capture Google AI Mode shopping cards into prompt_results - #86
Merged
Merged
Conversation
…ults Third companion to #46 (Perplexity) and #47 (Copilot). AI Mode returns its product cards under camelCase `shoppingCards` — verified against the live Cloro response (the issue text said snake_case, but the real key is camelCase, like Copilot). Unwrap it into the shared snake_case `shopping_cards` parsed key in the AI Mode branch; stored verbatim. Its separate `inlineProducts` array is a different surface, left out of scope per the issue. Closes #49
4 tasks
This was referenced May 26, 2026
Merged
This branch was successfully deployed
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
Third companion to #46 (Perplexity) and #47 (Copilot) — captures Google AI Mode's product cards into
prompt_results.shopping_cards, the same column, stored raw. Single-line-ish change in the AI Mode branch ofcloro-scraper.js.Closes #49
shoppingCards, not snake_caseThe issue says AI Mode returns snake_case
result.shopping_cards(like Perplexity). Against the live Cloro response that's not the case — AI Mode returns camelCaseshoppingCards(like Copilot). The issue's suggestedresult.shopping_cards ?? []would always yield[].Verified live (
google-aimode, "best wireless headphones under $200"):A real populated card:
{ "title": "Sony ULT WEAR Wireless Noise Canceling Headphones", "productLink": "https://www.google.com/search?...", "price": { "value": 148, "currency": "$", "raw": "$148.00. Was $248" }, "store": "Best Buy & more", "rating": 4.7, "reviews": "5.2K", "oldPrice": { "value": 248, "currency": "$", "raw": "$248" } }So the product shape is also camelCase (
productLink,oldPrice,price.raw), not the snake_case the issue table listed. We store verbatim regardless — the future UI should branch onplatform === 'google-aimode'and expect this shape.Change
server/src/lib/cloro-scraper.js, AI Mode branch:(
aiMode = result.result || result; live response is flat soaiMode === result. UsingaiModekeeps it consistent with howtext/sourcesare read in the same branch.)The separate
inlineProductsarray (also present, camelCase) is a different surface — left out of scope per the issue.Verification
node --checkpasses.shoppingCardsarray (above); the camelCase key + shape are confirmed against the real response.Notes
maincleanly.