Skip to content

feat(integrations): Shopify orders, with AI-referred revenue per product #1188

Closed as not planned

Description

@gkhngyk

Summary

Read the store's orders and count which ones AI assistants brought, per product. This feeds the "AI revenue" KPI and the revenue column in Products. It builds on the install in #1187.

Scope

  • Access:

    • Add the read_orders scope.
    • Request protected customer data access at level 1 in the Partner Dashboard. Shopify counts orders as customer data even without names, emails or addresses.
  • What we store:

    • Order id, created at, currency, the order's sales channel and the attribution below.
    • Line items: product and variant id, quantity, revenue.
    • No customer name, email, phone or address.
  • Attribution. An order counts as AI-referred when either:

    • its sales channel is an AI assistant (an order placed inside the assistant), or
    • the referrer or utm_source of its first or last visit classifies as an AI source with classifyAiSource. Read these from customerJourneySummary.firstVisit / lastVisit (referrerUrl, utmParameters). It is the same list the AI Traffic page uses (ai-sources.json).

    Record which rule matched, the AI source, and the list's source_list_version, as AI traffic does.

  • Sync:

    • The last 90 days on install.
    • Then orders/create and orders/updated webhooks, with the daily sync as the backstop.
    • Refunds reduce revenue.
  • Joins:

    • To catalog products by product and variant id.
    • To AI Traffic landing pages by the visit's landingPage.

Acceptance criteria

  • On a development store with test orders, AI revenue for a period equals the sum of its AI-referred orders, net of refunds.
  • Each AI-referred order records the rule and the source that matched.
  • No customer personal data is stored (checked against the stored rows).

Activity

  1. self-assigned this
    on Oct 19, 2026
  2. added
    enhancement
    integrations
    e-commerce
    security-review
    on Oct 19, 2026
  3. gkhngyk commented on Oct 20, 2026

    @gkhngyk
    ContributorAuthor

    Closing: the e-commerce plan is being reworked, and new issues will replace this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

e-commerceenhancementintegrationssecurity-review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions