Skip to content

feat(shopping): sidebar entry + Shopping overview page #104

@gkhngyk

Description

@gkhngyk

Context

With shopping cards now captured from Perplexity / AI Mode / Copilot (and ChatGPT pending in #95), brands need a dedicated lens on commercial-intent AI presence — separate from text-mention visibility. A product showing up in an AI shopping card is a fundamentally different signal than getting mentioned in a paragraph: high purchase intent, image + price + merchant in the slot, different competitive set.

This issue adds the Shopping page shell + Overview tab. Tabs My Products / Competitors / Prompts ship in follow-up issues (#C, #D).

Depends on: #103 (normalized prompt_result_shopping_cards table).

Acceptance criteria

  • Sidebar entry "Shopping" added under Citations in web/src/config/dashboard.ts with shopping-bag (lucide) icon.
  • i18n string keys added to web/messages/en.json and at minimum copy-propagated to tr.json (other 11 locales fall back via next-intl).
  • Route: web/src/app/[locale]/(dashboard)/dashboard/shopping/page.tsx — Cache Components (use cache), reads from the normalized table via a new server action in web/src/lib/actions/shopping.ts.
  • Filter bar at the top: Region, Platform (multi-select), Date range — wired to URL search params so refresh / share-link works.
  • Overview hero KPIs (server-rendered, cached):
    • Shopping card rate — % of tracked prompts that returned ≥1 card in the date range
    • Your products surfaced — distinct matched_brand_role='own' count
    • Your shopping share of voiceown / (own + competitor + other) cards in cards-bearing prompts
    • Top merchant for your products (most frequent merchant_domain where role=own)
  • Below KPIs: a platform × card-rate compact bar (Recharts), 30-day trend line of own-presence rate.
  • Page respects org scoping — no cross-org leakage. Same guard pattern as Insights/Citations.
  • Empty state when zero shopping cards exist for this org's prompts (e.g. brand is non-commercial): friendly explainer + link to docs about which platforms surface shopping.

Plan gating

  • Free / Starter — shows shopping card rate KPI only; My Products / Competitors / Prompts tabs (#C, #D) are pay-walled with a Growth CTA.
  • Growth / Enterprise / Self-hosted — full access.

Implement the gate via existing use-feature-gate hook with a new shopping_analytics feature flag in web/src/config/plans.ts. Self-host stays unrestricted.

Out of scope

  • My Products / Competitors / Prompts tab content — #C, #D
  • Pricing intelligence + Merchants tab — later (#F, #G)
  • MCP exposure — #E
  • Anomaly alerts — separate epic

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions