Skip to content

fix(shopping): store the products ChatGPT attaches to entities as inline product cards - #1193

Merged
gkhngyk merged 1 commit into
mainfrom
fix/chatgpt-inline-products
Oct 19, 2026
Merged

gkhngyk merged 1 commit into
mainfrom
fix/chatgpt-inline-products

Conversation

@gkhngyk

@gkhngyk gkhngyk commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Since 2026-10-16, no ChatGPT Shopping answer has carried inline products. Cloro now returns the listing ChatGPT attaches to a product it names as entities[n].product (Cloro changelog, entities schema), and the parser never read entities. This PR stores those products.

  • Parser: parseScraperResponse adds each entity listing to inline_products, in the { product } shape inline products already use.
  • Cards: persistShoppingCards now normalizes inline products into prompt_result_shopping_cards through the new normalizeInlineProducts.
    • They come after the carousel cards and take the positions after the carousel's last, so the two never collide on (prompt_result_id, position).
    • raw.surface = 'inline' tells them apart.
  • Where they show up: until now inline products were stored only raw on prompt_results, and nothing read them. With this PR they reach the Shopping page, the shopping-cards and product-visibility MCP tools and /v1/shopping-cards for the first time.
  • Shopping metrics: ChatGPT's "has cards" share on the Shopping page now counts answers with inline products too.

Probe (one Cloro task with include.shopping and include.rawResponse):

  • Cloro's fields: shoppingCards and inlineProducts came back empty, and 2 of the 6 product entities carried a listing.
  • Raw stream: it held only those 2 listings and no product carousel.
  • Replayed through this branch: the response gave 2 cards, each with title, price, image and merchant domain.

The carousel part of #1183 is ChatGPT's side and stays open.

Related issue

Refs #1183

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

cd server
npm run test -- src/lib/cloro-scraper.test.js src/lib/shopping-cards.test.js src/lib/cloro-result-handler.test.js

After deploy, on a brand with Shopping on: new chatgpt-shopping rows in prompt_result_shopping_cards with raw->>'surface' = 'inline' after the next tracking run.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • npm run lint, npm run format:check and npm run test pass (run from server/; no web/ changes)
  • Changes are focused — one concern per PR

🤖 Generated with Claude Code

https://claude.ai/code/session_0121amRjX7UFrgmGELAtkc7A

…ine product cards

Since 2026-10-16 Cloro returns the listing ChatGPT attaches to a product it
names as entities[n].product, and inlineProducts has come back empty since.
The parser never read entities, so these products were dropped.

- parseScraperResponse adds each entity listing to inline_products, in the
  { product } shape inline products already use.
- persistShoppingCards normalizes inline products into
  prompt_result_shopping_cards after the carousel cards. They take the
  positions after the carousel's last, so the two never collide, and
  raw.surface = 'inline' tells them apart.

Inline products were stored only raw on prompt_results until now, so they
reach the Shopping page, the MCP tools and the API for the first time.

Refs #1183

Claude-Session: https://claude.ai/code/session_0121amRjX7UFrgmGELAtkc7A
@gkhngyk gkhngyk added bug Something isn't working tracking Nightly cycle, workers, scraper providers, Daily Pulse e-commerce Shopping, product catalog, store and marketplace connectors labels Oct 19, 2026
@gkhngyk
gkhngyk merged commit 56c546e into main Oct 19, 2026
6 checks passed
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 19, 2026
main now has ansvisor#1176 (squash a98c35c, identical to this branch's 27f2ad2)
and ansvisor#1193. The conflicts are the files ansvisor#1177 extends after ansvisor#1176: this
branch's side kept; schema.sql rebuilt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 19, 2026
…raffic-untracked-queries

main now has ansvisor#1176 (squash, identical to the stack's first commit) and ansvisor#1193;
merged through feature/traffic-google-pages, which carries it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 19, 2026
…ure/traffic-bot-ingest

main now has ansvisor#1176 (squash, identical to the stack's first commit) and ansvisor#1193;
merged through feature/traffic-untracked-queries, which carries it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 19, 2026
…ffic-bot-logs

main now has ansvisor#1176 (squash, identical to the stack's first commit) and ansvisor#1193;
merged through feature/traffic-bot-ingest, which carries it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 19, 2026
…ic-bot-connect

main now has ansvisor#1176 (squash, identical to the stack's first commit) and ansvisor#1193;
merged through feature/traffic-bot-logs, which carries it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 19, 2026
…affic-bot-report

main now has ansvisor#1176 (squash, identical to the stack's first commit) and ansvisor#1193;
merged through feature/traffic-bot-connect, which carries it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 19, 2026
…ffic-broken-links

main now has ansvisor#1176 (squash, identical to the stack's first commit) and ansvisor#1193;
merged through feature/traffic-bot-report, which carries it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 19, 2026
…raffic-alerts

main now has ansvisor#1176 (squash, identical to the stack's first commit) and ansvisor#1193;
merged through feature/traffic-broken-links, which carries it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cihan-gyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 19, 2026
…-digest

main now has ansvisor#1176 (squash, identical to the stack's first commit) and ansvisor#1193;
merged through feature/traffic-alerts, which carries it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working e-commerce Shopping, product catalog, store and marketplace connectors tracking Nightly cycle, workers, scraper providers, Daily Pulse

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant