Skip to content

Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.

feat(shopping): say from Search Console whether Google shows the brand's products in its shopping results (#1751)

Cihan12a4201c2be0
diff --git a/server/src/lib/demo/coverage.js b/server/src/lib/demo/coverage.js
index 5bc69d8c7..aa26869eb 100644
--- a/server/src/lib/demo/coverage.js
+++ b/server/src/lib/demo/coverage.js
@@ -46,6 +46,8 @@ export const SKIPPED = {
"Chat's log of the changes it made (00402): Chat's precedence refuses every change on a demo brand, so none is logged.",
chat_access_requests:
"A person's request to their Admins for a Chat change (00403): theirs, not sample data, and a demo brand's refusal offers no Ask your Admin.",
+ gsc_shopping_page_stats:
+ "Search Console's shopping results by page (00377): the sync that reads them never runs for a demo brand, and with the brand's gsc_shopping_synced_at left empty, Readiness shows that item as not read yet and leaves it out of the score.",
};
const FOLLOW_UP =
diff --git a/server/src/lib/gsc-sync-pages.test.js b/server/src/lib/gsc-sync-pages.test.js
index 8c53fac68..21d933086 100644
--- a/server/src/lib/gsc-sync-pages.test.js
+++ b/server/src/lib/gsc-sync-pages.test.js
@@ -117,8 +117,9 @@ describe('the page sync', () => {
it('starts over when a first sync stops in the recent days', async () => {
state.failOn = day(13, Date.now());
await runGscSync({ brandId: 'b1' });
- // Nothing marked: the next sync reads the property from the start.
- expect(state.updates).toEqual([]);
+ // Nothing marked: the next sync reads the property from the start. (The
+ // shopping read is a step of its own, and marks its own fields.)
+ expect(state.updates.filter((update) => !('gsc_shopping_synced_at' in update))).toEqual([]);
expect(state.brand.gsc_pages_backfilled_property).toBeNull();
});
});
diff --git a/server/src/lib/gsc-sync-shopping.test.js b/server/src/lib/gsc-sync-shopping.test.js
new file mode 100644
index 000000000..a14f96129
--- /dev/null
+++ b/server/src/lib/gsc-sync-shopping.test.js
@@ -0,0 +1,192 @@
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+/**
+ * Does Google show the brand's products in its shopping results (00377)?
+ * The sync reads the property's appearance types, then each shopping one's
+ * pages by day filtered to it, and keeps them; a read the filter wasn't
+ * applied to is dropped rather than kept as every page shown.
+ */
+
+const state = vi.hoisted(() => ({
+ brand: null,
+ calls: [],
+ types: [],
+ pages: {},
+ upserts: [],
+ deletes: [],
+ updates: [],
+}));
+
+vi.mock('./composio.js', () => ({
+ isComposioConfigured: () => true,
+ queryGscSearchAnalytics: async (_entity, args) => {
+ state.calls.push(args);
+ if (args.dimensions[0] === 'searchAppearance') return state.types;
+ const filter = args.dimension_filter_groups?.[0]?.filters?.[0];
+ if (filter?.dimension === 'searchAppearance') return state.pages[filter.expression] ?? [];
+ return [];
+ },
+}));
+vi.mock('./logger.js', () => ({ logger: { info: vi.fn(), warn: vi.fn(), error: vi.fn() } }));
+vi.mock('../config/supabase.js', () => ({
+ default: {
+ from: (table) => {
+ let update = null;
+ let deleting = false;
+ const where = [];
+ const chain = {
+ select: () => chain,
+ eq: (column, value) => (where.push([column, value]), chain),
+ not: () => chain,
+ in: () => chain,
+ lt: (column, value) => (where.push([column, `< ${value}`]), chain),
+ delete: () => ((deleting = true), chain),
+ upsert: async (rows) => (state.upserts.push([table, rows]), { error: null }),
+ update: (fields) => ((update = fields), chain),
+ then: (resolve) => {
+ if (update) {
+ state.updates.push(update);
+ Object.assign(state.brand, update);
+ return resolve({ error: null });
+ }
+ if (deleting) {
+ state.deletes.push([table, where]);
+ return resolve({ error: null });
+ }
+ if (table === 'integration_connections') {
+ return resolve({ data: [{ organization_id: 'o1' }], error: null });
+ }
+ if (table === 'brands') return resolve({ data: [{ ...state.brand }], error: null });
+ return resolve({ error: null });
+ },
+ };
+ return chain;
+ },
+ },
+}));
+vi.mock('./active-subscriptions.js', () => ({ activeOrgFilter: async () => () => true }));
+
+const { mapShoppingRows, runGscSync, shoppingAppearance } = await import('./gsc-sync.js');
+
+const row = (page, date, impressions) => ({
+ keys: [page, date],
+ clicks: 1,
+ impressions,
+ ctr: 0.1,
+ position: 3,
+});
+
+beforeEach(() => {
+ state.brand = {
+ id: 'b1',
+ organization_id: 'o1',
+ gsc_property: 'sc-domain:acme.com',
+ gsc_pages_backfilled_property: 'sc-domain:acme.com',
+ gsc_pages_backfill_from: null,
+ gsc_shopping_property: null,
+ };
+ state.calls = [];
+ state.types = [];
+ state.pages = {};
+ state.upserts = [];
+ state.deletes = [];
+ state.updates = [];
+});
+
+const shoppingRows = () =>
+ state.upserts.filter(([table]) => table === 'gsc_shopping_page_stats').flatMap(([, r]) => r);
+
+describe('shoppingAppearance', () => {
+ it('names the shopping types however the API spells them, and nothing else', () => {
+ expect(shoppingAppearance('MERCHANT_LISTINGS')).toBe('merchant_listings');
+ expect(shoppingAppearance('Merchant listings')).toBe('merchant_listings');
+ expect(shoppingAppearance('PRODUCT_SNIPPETS')).toBe('product_snippets');
+ expect(shoppingAppearance('REVIEW_SNIPPET')).toBeNull();
+ expect(shoppingAppearance(undefined)).toBeNull();
+ });
+
+ it('maps a type’s rows to the table’s', () => {
+ expect(
+ mapShoppingRows('b1', 'product_snippets', [row('https://acme.com/a', '2026-10-01', 9)]),
+ ).toEqual([
+ {
+ brand_id: 'b1',
+ page: 'https://acme.com/a',
+ date: '2026-10-01',
+ clicks: 1,
+ impressions: 9,
+ ctr: 0.1,
+ position: 3,
+ appearance: 'product_snippets',
+ },
+ ]);
+ });
+});
+
+describe('the shopping sync', () => {
+ it("reads the property's types, then each shopping one's pages filtered to it", async () => {
+ state.types = [
+ { keys: ['MERCHANT_LISTINGS'], impressions: 30 },
+ { keys: ['PRODUCT_SNIPPETS'], impressions: 5 },
+ { keys: ['FAQ_RICH_RESULT'], impressions: 400 },
+ ];
+ state.pages = {
+ MERCHANT_LISTINGS: [row('https://acme.com/kettle', '2026-10-01', 30)],
+ PRODUCT_SNIPPETS: [row('https://acme.com/mug', '2026-10-02', 5)],
+ };
+ await runGscSync({ brandId: 'b1' });
+
+ const appearances = state.calls.filter((c) => c.dimensions[0] === 'searchAppearance');
+ expect(appearances).toHaveLength(1);
+ // Counted by page, as the page rows are: by property, a result showing
+ // several of the shop's products counts once.
+ expect(appearances[0].aggregation_type).toBe('byPage');
+ const filtered = state.calls
+ .map((c) => c.dimension_filter_groups?.[0]?.filters?.[0]?.expression)
+ .filter(Boolean);
+ expect(filtered).toEqual(['MERCHANT_LISTINGS', 'PRODUCT_SNIPPETS']);
+ expect(shoppingRows().map((r) => [r.page, r.appearance])).toEqual([
+ ['https://acme.com/kettle', 'merchant_listings'],
+ ['https://acme.com/mug', 'product_snippets'],
+ ]);
+ expect(state.brand).toMatchObject({
+ gsc_shopping_property: 'sc-domain:acme.com',
+ gsc_shopping_synced_at: expect.any(String),
+ });
+ });
+
+ it('drops a read the filter was not applied to, and leaves the brand unread, not showing none', async () => {
+ state.brand.gsc_shopping_synced_at = '2026-10-20T00:00:00.000Z';
+ state.types = [
+ { keys: ['MERCHANT_LISTINGS'], impressions: 3 },
+ { keys: ['PRODUCT_SNIPPETS'], impressions: 5 },
+ ];
+ // Every page of the property, as an unfiltered read would give.
+ state.pages = {
+ MERCHANT_LISTINGS: [
+ row('https://acme.com/a', '2026-10-01', 900),
+ row('https://acme.com/b', '2026-10-01', 400),
+ ],
+ PRODUCT_SNIPPETS: [row('https://acme.com/mug', '2026-10-02', 5)],
+ };
+ await runGscSync({ brandId: 'b1' });
+ expect(shoppingRows().map((r) => [r.page, r.appearance])).toEqual([
+ ['https://acme.com/mug', 'product_snippets'],
+ ]);
+ expect(state.brand.gsc_shopping_synced_at).toBeNull();
+ });
+
+ it("drops another property's rows first, and marks a property with none shown as read", async () => {
+ state.brand.gsc_shopping_property = 'sc-domain:old.com';
+ await runGscSync({ brandId: 'b1' });
+ expect(state.deletes).toContainEqual(['gsc_shopping_page_stats', [['brand_id', 'b1']]]);
+ expect(shoppingRows()).toEqual([]);
+ expect(state.brand.gsc_shopping_property).toBe('sc-domain:acme.com');
+ });
+
+ it('prunes rows older than 90 days on the daily run', async () => {
+ state.brand.gsc_shopping_property = 'sc-domain:acme.com';
+ await runGscSync();
+ expect(state.deletes.some(([table]) => table === 'gsc_shopping_page_stats')).toBe(true);
+ });
+});
diff --git a/server/src/lib/gsc-sync.js b/server/src/lib/gsc-sync.js
index 3aa31ecbd..299816d65 100644
--- a/server/src/lib/gsc-sync.js
+++ b/server/src/lib/gsc-sync.js
@@ -3,8 +3,10 @@
*
* For every active brand mapped to a GSC property (whose org connection is
* live), pulls the last SYNC_WINDOW_DAYS of per-query daily stats through
- * Composio and upserts them into gsc_query_stats, and the same per page into
- * gsc_page_stats (AT-008: which pages lose clicks while impressions rise). A
+ * Composio and upserts them into gsc_query_stats, the same per page into
+ * gsc_page_stats (AT-008: which pages lose clicks while impressions rise),
+ * and the pages Google showed in its shopping results into
+ * gsc_shopping_page_stats (00377: Product Visibility's Readiness). A
* brand's page sync reads a week at a time, and reads its property's
* PAGE_BACKFILL_DAYS once, resuming where a sync stopped, so a 90-day range
* has a period before it (pagesSyncPlan).
@@ -125,6 +127,123 @@ async function pullWindow(brand, { dimension, table, onConflict, map }, { from,
return total;
}
+// ─── Shopping results (00377) ────────────────────────────────────────────────
+
+/** Shopping rows are kept this long, as query rows are. */
+const SHOPPING_KEEP_DAYS = 90;
+/** Appearance types a property has, at most: there are a few dozen. */
+const APPEARANCE_ROW_LIMIT = 100;
+
+/**
+ * The shopping appearance an API type names: merchant listings (the free
+ * shopping listings) or product snippets (price, rating and stock under a
+ * result); null for any other. Matched by name, not one exact string, so
+ * the API's spelling (MERCHANT_LISTINGS, "Merchant listings") doesn't matter.
+ */
+export function shoppingAppearance(type) {
+ const name = String(type ?? '')
+ .toLowerCase()
+ .replace(/[^a-z]/g, '');
+ if (name.includes('merchantlisting')) return 'merchant_listings';
+ if (name.includes('productsnippet')) return 'product_snippets';
+ return null;
+}
+
+/** Map one appearance's GSC rows ({keys:[page,date],...}) to gsc_shopping_page_stats rows. */
+export function mapShoppingRows(brandId, appearance, rows) {
+ return mapPageRows(brandId, rows).map((row) => ({ ...row, appearance }));
+}
+
+/**
+ * The pages Google showed in its shopping results over the last
+ * SYNC_WINDOW_DAYS, read in the two steps the API needs (search appearance
+ * can't be a column beside the page): the property's appearance types, then
+ * each shopping type's pages by day, filtered to it. Both steps count
+ * impressions by page: counted by property, a result showing several of the
+ * shop's products counts once, and a shop's pages would always add up past
+ * it. A filtered read whose impressions pass its type's total by more than
+ * rounding means the filter wasn't applied: it is dropped, not kept as every
+ * page shown, and the brand is left unread rather than read as showing
+ * none. The brand's rows from another property are dropped first. Returns
+ * the rows written.
+ */
+async function syncBrandShopping(brand, now = Date.now()) {
+ const entityId = `org_${brand.organization_id}`;
+ if (brand.gsc_shopping_property && brand.gsc_shopping_property !== brand.gsc_property) {
+ const { error } = await supabaseAdmin
+ .from('gsc_shopping_page_stats')
+ .delete()
+ .eq('brand_id', brand.id);
+ if (error) throw new Error(error.message);
+ }
+ const window = {
+ site_url: brand.gsc_property,
+ start_date: utcDateString(SYNC_WINDOW_DAYS),
+ end_date: utcDateString(0),
+ search_type: 'web',
+ aggregation_type: 'auto',
+ data_state: 'final',
+ };
+ const types = await queryGscSearchAnalytics(entityId, {
+ ...window,
+ // As the page rows below are counted, so their sums compare.
+ aggregation_type: 'byPage',
+ dimensions: ['searchAppearance'],
+ row_limit: APPEARANCE_ROW_LIMIT,
+ start_row: 0,
+ dimension_filter_groups: [],
+ });
+
+ let total = 0;
+ let dropped = false;
+ for (const type of types) {
+ const name = type.keys?.[0];
+ const appearance = shoppingAppearance(name);
+ if (!appearance) continue;
+ const rows = [];
+ for (let page = 0; page < MAX_PAGES; page++) {
+ const batch = await queryGscSearchAnalytics(entityId, {
+ ...window,
+ dimensions: ['page', 'date'],
+ row_limit: ROW_LIMIT,
+ start_row: page * ROW_LIMIT,
+ dimension_filter_groups: [
+ {
+ groupType: 'and',
+ filters: [{ dimension: 'searchAppearance', operator: 'equals', expression: name }],
+ },
+ ],
+ });
+ rows.push(...batch);
+ if (batch.length < ROW_LIMIT) break;
+ }
+ const impressions = rows.reduce((sum, row) => sum + (row.impressions || 0), 0);
+ if (impressions > (type.impressions || 0) * 1.05 + 10) {
+ logger.error(
+ { brandId: brand.id, appearance: name, impressions, expected: type.impressions },
+ '[gsc-sync] shopping filter not applied — rows dropped',
+ );
+ dropped = true;
+ continue;
+ }
+ const mapped = mapShoppingRows(brand.id, appearance, rows);
+ for (let i = 0; i < mapped.length; i += UPSERT_CHUNK) {
+ const { error } = await supabaseAdmin
+ .from('gsc_shopping_page_stats')
+ .upsert(mapped.slice(i, i + UPSERT_CHUNK), { onConflict: 'brand_id,page,appearance,date' });
+ if (error) throw new Error(`Upsert failed: ${error.message}`);
+ }
+ total += mapped.length;
+ }
+ // A dropped read leaves the brand unread: Readiness then says it can't
+ // tell, never that Google shows none of its products.
+ await updateBrand(brand, {
+ gsc_shopping_property: brand.gsc_property,
+ gsc_shopping_synced_at: dropped ? null : new Date(now).toISOString(),
+ });
+ return total;
+}
+
const QUERIES = {
dimension: 'query',
table: 'gsc_query_stats',
@@ -233,7 +352,7 @@ export async function runGscSync({ organizationId, brandId } = {}) {
let brandQuery = supabaseAdmin
.from('brands')
.select(
- 'id, organization_id, gsc_property, gsc_pages_backfilled_property, gsc_pages_backfill_from',
+ 'id, organization_id, gsc_property, gsc_pages_backfilled_property, gsc_pages_backfill_from, gsc_shopping_property',
)
.eq('is_active', true)
// A demo brand's figures (00380) are sample data, never synced.
@@ -258,7 +377,14 @@ export async function runGscSync({ organizationId, brandId } = {}) {
} catch (err) {
logger.error({ err, brandId: brand.id }, '[gsc-sync] page sync failed');
}
- results.push({ brandId: brand.id, rows: count, pages });
+ // So are the shopping results (00377).
+ let shopping = null;
+ try {
+ shopping = await syncBrandShopping(brand);
+ } catch (err) {
+ logger.error({ err, brandId: brand.id }, '[gsc-sync] shopping sync failed');
+ }
+ results.push({ brandId: brand.id, rows: count, pages, shopping });
synced++;
} catch (err) {
logger.error({ err, brandId: brand.id }, '[gsc-sync] brand sync failed');
@@ -285,6 +411,13 @@ export async function runGscSync({ organizationId, brandId } = {}) {
if (pagePruneError) {
logger.warn({ err: pagePruneError }, '[gsc-sync] page retention prune failed');
}
+ const { error: shoppingPruneError } = await supabaseAdmin
+ .from('gsc_shopping_page_stats')
+ .delete()
+ .lt('date', utcDateString(SHOPPING_KEEP_DAYS));
+ if (shoppingPruneError) {
+ logger.warn({ err: shoppingPruneError }, '[gsc-sync] shopping retention prune failed');
+ }
}
logger.info({ synced, skipped, total: (brands || []).length }, '[gsc-sync] completed');
diff --git a/supabase/migrations/00377_gsc_shopping_appearance.sql b/supabase/migrations/00377_gsc_shopping_appearance.sql
new file mode 100644
index 000000000..42671351f
--- /dev/null
+++ b/supabase/migrations/00377_gsc_shopping_appearance.sql
@@ -0,0 +1,72 @@
+-- ============================================================================
+-- 00377: does Google show the brand's products in its shopping results?
+-- ============================================================================
+-- Product Visibility's Readiness asked for a Google Merchant Center feed,
+-- which this deployment may not be able to connect. Search Console says it
+-- too, from the brand's own property: the pages Google shows as merchant
+-- listings (the free shopping listings, fed by Merchant Center or by the
+-- page's product schema) and as product snippets (a product's price,
+-- rating and stock under its result).
+--
+-- The Search Analytics API can't give search appearance as a column beside
+-- the page, so the sync (server/src/lib/gsc-sync.js) asks in two steps: the
+-- property's appearance types over the last 28 days, then each shopping one's
+-- pages by day, filtered to it. gsc_shopping_page_stats keeps those rows; the
+-- sync (service role) upserts on (brand_id, page, appearance, date), and
+-- members read them. Rows older than 90 days are pruned, as queries' are.
+--
+-- brands.gsc_shopping_property is the property whose shopping rows the brand
+-- has (another one's are dropped first), and gsc_shopping_synced_at when they
+-- were last read: before the first read, Readiness says it doesn't know yet
+-- rather than that no product shows.
+
+create table if not exists public.gsc_shopping_page_stats (
+ id uuid primary key default gen_random_uuid(),
+ brand_id uuid not null references public.brands(id) on delete cascade,
+ page text not null,
+ -- merchant_listings | product_snippets
+ appearance text not null check (appearance in ('merchant_listings', 'product_snippets')),
+ date date not null,
+ clicks integer not null default 0,
+ impressions integer not null default 0,
+ ctr double precision not null default 0,
+ position double precision not null default 0,
+ created_at timestamptz not null default now(),
+ unique (brand_id, page, appearance, date)
+);
+
+create index if not exists gsc_shopping_page_stats_brand_date_idx
+ on public.gsc_shopping_page_stats (brand_id, date desc);
+
+-- The sync's table-wide retention prune (date < 90 days ago).
+create index if not exists gsc_shopping_page_stats_date_idx
+ on public.gsc_shopping_page_stats (date);
+
+alter table public.gsc_shopping_page_stats enable row level security;
+
+create policy "gsc_shopping_page_stats: member select" on public.gsc_shopping_page_stats
+ for select using (
+ brand_id in (
+ select b.id
+ from public.brands b
+ join public.profiles p on p.organization_id = b.organization_id
+ where p.id = auth.uid()
+ )
+ );
+
+revoke all on table public.gsc_shopping_page_stats from anon, authenticated;
+grant select on public.gsc_shopping_page_stats to authenticated;
+
+comment on table public.gsc_shopping_page_stats is
+ 'Product Visibility Readiness (00377): the brand''s Search Console pages Google showed as merchant listings or product snippets, by day. Synced from the brand''s own property (gsc-sync.js); members read.';
+
+alter table public.brands
+ add column if not exists gsc_shopping_property text,
+ add column if not exists gsc_shopping_synced_at timestamptz;
+
+comment on column public.brands.gsc_shopping_property is
+ '00377: the Search Console property gsc_shopping_page_stats''s rows for the brand come from; when it names another, they are dropped first (gsc-sync.js).';
+comment on column public.brands.gsc_shopping_synced_at is
+ '00377: when the brand''s shopping appearance rows were last read; null before the first read, when Readiness doesn''t know yet.';
+
+notify pgrst, 'reload schema';
diff --git a/supabase/schema.sql b/supabase/schema.sql
index 05431802b..7fff9f880 100644
--- a/supabase/schema.sql
+++ b/supabase/schema.sql
@@ -43703,6 +43703,82 @@ grant execute on function public.competitor_cited_urls(uuid, timestamptz) to ser
notify pgrst, 'reload schema';
+-- ─────────────────────────────────────────────────────────────────────────
+-- migrations/00377_gsc_shopping_appearance.sql
+-- ─────────────────────────────────────────────────────────────────────────
+-- ============================================================================
+-- 00377: does Google show the brand's products in its shopping results?
+-- ============================================================================
+-- Product Visibility's Readiness asked for a Google Merchant Center feed,
+-- which this deployment may not be able to connect. Search Console says it
+-- too, from the brand's own property: the pages Google shows as merchant
+-- listings (the free shopping listings, fed by Merchant Center or by the
+-- page's product schema) and as product snippets (a product's price,
+-- rating and stock under its result).
+--
+-- The Search Analytics API can't give search appearance as a column beside
+-- the page, so the sync (server/src/lib/gsc-sync.js) asks in two steps: the
+-- property's appearance types over the last 28 days, then each shopping one's
+-- pages by day, filtered to it. gsc_shopping_page_stats keeps those rows; the
+-- sync (service role) upserts on (brand_id, page, appearance, date), and
+-- members read them. Rows older than 90 days are pruned, as queries' are.
+--
+-- brands.gsc_shopping_property is the property whose shopping rows the brand
+-- has (another one's are dropped first), and gsc_shopping_synced_at when they
+-- were last read: before the first read, Readiness says it doesn't know yet
+-- rather than that no product shows.
+
+create table if not exists public.gsc_shopping_page_stats (
+ id uuid primary key default gen_random_uuid(),
+ brand_id uuid not null references public.brands(id) on delete cascade,
+ page text not null,
+ -- merchant_listings | product_snippets
+ appearance text not null check (appearance in ('merchant_listings', 'product_snippets')),
+ date date not null,
+ clicks integer not null default 0,
+ impressions integer not null default 0,
+ ctr double precision not null default 0,
+ position double precision not null default 0,
+ created_at timestamptz not null default now(),
+ unique (brand_id, page, appearance, date)
+);
+
+create index if not exists gsc_shopping_page_stats_brand_date_idx
+ on public.gsc_shopping_page_stats (brand_id, date desc);
+
+-- The sync's table-wide retention prune (date < 90 days ago).
+create index if not exists gsc_shopping_page_stats_date_idx
+ on public.gsc_shopping_page_stats (date);
+
+alter table public.gsc_shopping_page_stats enable row level security;
+
+create policy "gsc_shopping_page_stats: member select" on public.gsc_shopping_page_stats
+ for select using (
+ brand_id in (
+ select b.id
+ from public.brands b
+ join public.profiles p on p.organization_id = b.organization_id
+ where p.id = auth.uid()
+ )
+ );
+
+revoke all on table public.gsc_shopping_page_stats from anon, authenticated;
+grant select on public.gsc_shopping_page_stats to authenticated;
+
+comment on table public.gsc_shopping_page_stats is
+ 'Product Visibility Readiness (00377): the brand''s Search Console pages Google showed as merchant listings or product snippets, by day. Synced from the brand''s own property (gsc-sync.js); members read.';
+
+alter table public.brands
+ add column if not exists gsc_shopping_property text,
+ add column if not exists gsc_shopping_synced_at timestamptz;
+
+comment on column public.brands.gsc_shopping_property is
+ '00377: the Search Console property gsc_shopping_page_stats''s rows for the brand come from; when it names another, they are dropped first (gsc-sync.js).';
+comment on column public.brands.gsc_shopping_synced_at is
+ '00377: when the brand''s shopping appearance rows were last read; null before the first read, when Readiness doesn''t know yet.';
+
+notify pgrst, 'reload schema';
+
-- ─────────────────────────────────────────────────────────────────────────
-- migrations/00379_brand_site_type_source.sql
-- ─────────────────────────────────────────────────────────────────────────
diff --git a/web/messages/en.json b/web/messages/en.json
index 53a233f3b..771d45114 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -9019,6 +9019,13 @@
"fail": "In Europe it decides ChatGPT too: connect it.",
"unknown": "Couldn't read your catalog sources right now."
},
+ "googleShopping": {
+ "title": "Google shows your products in shopping results (Search Console)",
+ "pass": "{count} of your {total, plural, one {# product page} other {# product pages}} showed as a merchant listing or product snippet in the last 28 days.",
+ "warn": "Only {count} of your {total, plural, one {# product page} other {# product pages}} showed as a merchant listing or product snippet in the last 28 days. Product schema on the rest (price, availability, GTIN) helps Google list them.",
+ "fail": "Google hasn't shown any of your {total, plural, one {# product page} other {# product pages}} as a merchant listing or product snippet in the last 28 days. Check the product schema on your product pages (price, availability, GTIN).",
+ "unknown": "{reason, select, not_connected {Connect Search Console to see whether Google shows your products in its shopping results.} not_synced {Search Console's shopping results come with its next daily sync.} no_pages {None of your catalog's products has a page address to look for in Search Console.} other {Couldn't read Search Console right now.}}"
+ },
"openAiIndex": {
"title": "Catalog in OpenAI's product index",
"pass": "You send OpenAI a direct product feed.",
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/shopping/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/shopping/page.tsx
index ce1824a7e..2cc9a44ec 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/shopping/page.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/shopping/page.tsx
@@ -41,6 +41,7 @@ import {
getShoppingActionResults,
getShoppingCategories,
getShoppingProducts,
+ getShoppingSearchAppearance,
getShoppingShelf,
type ShoppingChartData,
type ShoppingDatePreset,
@@ -317,6 +318,13 @@ export default function ShoppingPage() {
);
// Null for a brand without a catalog, and while it reads.
const catalogTable: ShoppingProducts | null | 'failed' = productsRead ?? null;
+ // Google's shopping results from Search Console (00377), for Readiness.
+ const searchAppearance = useKeyedRead(
+ canRead && activeTab === 'readiness',
+ activeBrandId ?? '',
+ () => getShoppingSearchAppearance(activeBrandId!),
+ "Search Console's shopping results",
+ );
// The Categories tab reads when it's open, once per brand and filters.
const categoriesKey = `${activeBrandId}:${JSON.stringify(filters)}`;
@@ -643,6 +651,8 @@ export default function ShoppingPage() {
market: shoppingMarket.shown ?? 'us',
catalog: sources.catalog,
merchantCenterOffered: sources.merchantCenterOffered,
+ searchAppearance:
+ searchAppearance && searchAppearance !== 'failed' ? searchAppearance : null,
products: catalogTable && catalogTable !== 'failed' ? catalogTable.rows : null,
openAi: showOpenAiIndex ? openAiIndex.read : null,
cheaperResellers: destinationsLoading ? null : destinations.priceAlerts.length,
diff --git a/web/src/lib/actions/shopping-search-appearance.test.ts b/web/src/lib/actions/shopping-search-appearance.test.ts
new file mode 100644
index 000000000..bfe035949
--- /dev/null
+++ b/web/src/lib/actions/shopping-search-appearance.test.ts
@@ -0,0 +1,76 @@
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+/**
+ * The brand's pages Google showed in its shopping results, from its own
+ * Search Console property (00377), for Product Visibility's Readiness; or
+ * why it can't say.
+ */
+
+const BRAND = '5b0c3b8e-8a5f-4a41-9d0e-1f2a3b4c5d6e';
+
+let brandRow: { gsc_property: string | null; gsc_shopping_synced_at: string | null } | null;
+let statRows: { page: string }[];
+let statFilters: [string, unknown][];
+
+vi.mock('@/lib/supabase/server', () => ({
+ createClient: async () => ({
+ from: (table: string) => {
+ const builder = {
+ select: () => builder,
+ eq: (column: string, value: unknown) => {
+ if (table === 'gsc_shopping_page_stats') statFilters.push([column, value]);
+ return builder;
+ },
+ gte: (column: string, value: unknown) => {
+ statFilters.push([column, value]);
+ return builder;
+ },
+ gt: (column: string, value: unknown) => {
+ statFilters.push([column, value]);
+ return builder;
+ },
+ order: () => builder,
+ range: async (from: number, to: number) => ({
+ data: statRows.slice(from, to + 1),
+ error: null,
+ }),
+ maybeSingle: async () => ({ data: brandRow, error: null }),
+ };
+ return builder;
+ },
+ }),
+}));
+
+const { getShoppingSearchAppearance } = await import('./shopping');
+
+beforeEach(() => {
+ brandRow = { gsc_property: 'sc-domain:shop.example', gsc_shopping_synced_at: '2026-10-28' };
+ statRows = [];
+ statFilters = [];
+});
+
+describe('getShoppingSearchAppearance', () => {
+ it('reads the pages shown over the last 28 days, once each by page key', async () => {
+ statRows = [
+ { page: 'https://www.shop.example/products/a/' },
+ { page: 'https://shop.example/products/a?variant=2' },
+ { page: 'https://shop.example/products/b' },
+ ];
+ expect(await getShoppingSearchAppearance(BRAND)).toEqual({
+ state: 'read',
+ pages: ['shop.example/products/a', 'shop.example/products/b'],
+ });
+ expect(statFilters).toEqual([
+ ['brand_id', BRAND],
+ ['date', expect.stringMatching(/^\d{4}-\d{2}-\d{2}$/)],
+ ['impressions', 0],
+ ]);
+ });
+
+ it('says when Search Console is not mapped, or not read yet', async () => {
+ brandRow = { gsc_property: null, gsc_shopping_synced_at: null };
+ expect(await getShoppingSearchAppearance(BRAND)).toEqual({ state: 'not_connected', pages: [] });
+ brandRow = { gsc_property: 'sc-domain:shop.example', gsc_shopping_synced_at: null };
+ expect(await getShoppingSearchAppearance(BRAND)).toEqual({ state: 'not_synced', pages: [] });
+ });
+});
diff --git a/web/src/lib/actions/shopping.ts b/web/src/lib/actions/shopping.ts
index f1d5c26d7..e8719bc96 100644
--- a/web/src/lib/actions/shopping.ts
+++ b/web/src/lib/actions/shopping.ts
@@ -4,6 +4,8 @@ import { API_BASE_URL } from '@/config/api';
import { createClient } from '@/lib/supabase/server';
import { dbClient } from '@/lib/supabase/scoped';
import { readAllRpcRows } from '@/lib/supabase/rpc-pages';
+import { pageKey } from '@/lib/content/feed-match';
+import type { ShoppingSearchAppearance } from '@/lib/shopping/readiness';
import { expandDateToEndOfDay } from '@/lib/dates';
import {
detectAmazonShareDrop,
@@ -354,6 +356,47 @@ export async function getResellerPriceAlerts(
* values that actually appear in this brand's data — all of it, not the first
* 1,000 results.
*/
+/** Days of Search Console shopping results Readiness reads, as the sync's window. */
+const SEARCH_APPEARANCE_DAYS = 28;
+
+/**
+ * The brand's pages Google showed as merchant listings or product snippets
+ * over the last 28 days, from its own Search Console property (00377), by
+ * page key; or why it can't say: no property mapped, or not read yet.
+ */
+export async function getShoppingSearchAppearance(
+ brandId: string,
+): Promise<ShoppingSearchAppearance> {
+ const supabase = await dbClient();
+ const { data: brand, error } = await supabase
+ .from('brands')
+ .select('gsc_property, gsc_shopping_synced_at')
+ .eq('id', brandId)
+ .maybeSingle();
+ if (error) throw new Error(error.message);
+ if (!brand?.gsc_property) return { state: 'not_connected', pages: [] };
+ if (!brand.gsc_shopping_synced_at) return { state: 'not_synced', pages: [] };
+ const since = new Date(Date.now() - SEARCH_APPEARANCE_DAYS * 86_400_000)
+ .toISOString()
+ .slice(0, 10);
+ const rows = await readAllRpcRows<{ page: string }>(
+ (from, to) =>
+ supabase
+ .from('gsc_shopping_page_stats')
+ .select('page')
+ .eq('brand_id', brandId)
+ .gte('date', since)
+ .gt('impressions', 0)
+ .order('id')
+ .range(from, to) as unknown as PromiseLike<{
+ data: { page: string }[] | null;
+ error: { message: string } | null;
+ }>,
+ );
+ const pages = new Set(rows.flatMap((row) => pageKey(row.page) ?? []));
+ return { state: 'read', pages: [...pages] };
+}
+
export async function getShoppingFilterOptions(brandId: string): Promise<{
platforms: string[];
regions: string[];
diff --git a/web/src/lib/mcp/product-visibility.test.ts b/web/src/lib/mcp/product-visibility.test.ts
index e630b9477..2b67aad46 100644
--- a/web/src/lib/mcp/product-visibility.test.ts
+++ b/web/src/lib/mcp/product-visibility.test.ts
@@ -65,6 +65,7 @@ const shopping = vi.hoisted(() => ({
getShoppingAmazonShareDropAlert: vi.fn(),
getShoppingFilterOptions: vi.fn(),
getShoppingOwnChannels: vi.fn(),
+ getShoppingSearchAppearance: vi.fn(),
}));
vi.mock('@/lib/actions/shopping', () => shopping);
const getBrandMarketCountries = vi.hoisted(() => vi.fn());
@@ -176,6 +177,7 @@ beforeEach(() => {
shopping.getShoppingAmazonShareDropAlert.mockReset();
shopping.getShoppingFilterOptions.mockReset();
shopping.getShoppingOwnChannels.mockReset();
+ shopping.getShoppingSearchAppearance.mockReset();
getOpenAiIndexRead.mockReset();
readCatalogSources.mockReset();
});
@@ -399,6 +401,7 @@ describe('get_shopping_readiness', () => {
regions: [],
});
shopping.getShoppingOwnChannels.mockImplementation(loader(() => ['google-aimode']));
+ shopping.getShoppingSearchAppearance.mockResolvedValue({ state: 'not_connected', pages: [] });
// The API offers Merchant Center (its internal config, read with the cron secret).
vi.stubEnv('CRON_SECRET', 'cron-secret');
vi.stubGlobal(
@@ -452,6 +455,16 @@ describe('get_shopping_readiness', () => {
fix: null,
});
expect(check('merchantCenter')).toMatchObject({ state: 'warn', fix: 'settings' });
+ // Google's shopping results, from the brand's Search Console (00377).
+ expect(shopping.getShoppingSearchAppearance).toHaveBeenCalledWith(BRAND);
+ expect(check('googleShopping')).toEqual({
+ key: 'googleShopping',
+ state: 'unknown',
+ title: 'Google shows your products in shopping results (Search Console)',
+ detail:
+ 'Connect Search Console to see whether Google shows your products in its shopping results.',
+ fix: 'settings',
+ });
expect(check('openAiIndex')).toMatchObject({
state: 'warn',
title: "Catalog in OpenAI's product index",
diff --git a/web/src/lib/mcp/product-visibility.ts b/web/src/lib/mcp/product-visibility.ts
index e75ef31c9..b2d7f019c 100644
--- a/web/src/lib/mcp/product-visibility.ts
+++ b/web/src/lib/mcp/product-visibility.ts
@@ -8,6 +8,7 @@ import {
getShoppingFilterOptions,
getShoppingOwnChannels,
getShoppingProducts,
+ getShoppingSearchAppearance,
getShoppingShelf,
type ShoppingDatePreset,
type ShoppingFilters,
@@ -320,7 +321,7 @@ export async function getShoppingReadinessFor(
const own = await marketOf(brandId, params.market);
const market = own ?? 'us';
const filters: ShoppingFilters = { datePreset: period, chatgptMarket: own ?? undefined };
- const [sources, products, openAi, cheaper, amazonDrop, options, ownOn, gmcOffered] =
+ const [sources, products, openAi, cheaper, amazonDrop, options, ownOn, gmcOffered, search] =
await Promise.all([
orNull('catalog sources', readCatalogSources(supabaseAdmin, brandId)),
getShoppingProducts(brandId, filters).then(
@@ -338,11 +339,13 @@ export async function getShoppingReadinessFor(
// Which channels hold its products: one row a channel, not every card on the shelves.
orNull('the channels', getShoppingOwnChannels(brandId, filters)),
merchantCenterOffered(),
+ orNull("Search Console's shopping results", getShoppingSearchAppearance(brandId)),
]);
const { score, items } = readinessChecklist({
market,
catalog: sources,
merchantCenterOffered: gmcOffered,
+ searchAppearance: search,
products: products === 'failed' ? null : products,
openAi,
cheaperResellers: cheaper?.length ?? null,
diff --git a/web/src/lib/mcp/server.ts b/web/src/lib/mcp/server.ts
index 1c9696182..578584fe5 100644
--- a/web/src/lib/mcp/server.ts
+++ b/web/src/lib/mcp/server.ts
@@ -2243,7 +2243,7 @@ export function createMcpServer(auth: McpAuthContext): McpServer {
{
title: 'Product Visibility readiness',
description:
- "Product Visibility's Readiness: how ready the brand is for AI shopping, as the Readiness tab checks it, scored 0–100 over the checks that can be made (`score`; null when its catalog's sources or products couldn't be read, listed in `unread`). Each check has its `key` (catalog, merchantCenter where this server offers Google Merchant Center or the brand has it connected, openAiIndex and verifiedSeller in the US, firstWords, feedFields, feedLinks, wrongPrice, resellerCheaper, amazonShare), its `state` (pass, warn, fail, or unknown when it can't be made), its `title` and `detail` as the page writes them, and `fix`: where it starts (products = the Products tab, settings = Settings › Integrations › Catalog). `channels` says for each AI channel (chatgpt-shopping, google-aio, google-aimode, gemini-web, copilot-web) whether the brand's products are on its shelves (showing), its shelves are read without them (notShowing), or it isn't tracked (notTracked). Needs a plan with Product Visibility (Growth and above): on Starter it answers plan_limit.",
+ "Product Visibility's Readiness: how ready the brand is for AI shopping, as the Readiness tab checks it, scored 0–100 over the checks that can be made (`score`; null when its catalog's sources or products couldn't be read, listed in `unread`). Each check has its `key` (catalog, merchantCenter where this server offers Google Merchant Center or the brand has it connected, googleShopping: whether Google showed its product pages as merchant listings or product snippets in Search Console over 28 days, openAiIndex and verifiedSeller in the US, firstWords, feedFields, feedLinks, wrongPrice, resellerCheaper, amazonShare), its `state` (pass, warn, fail, or unknown when it can't be made), its `title` and `detail` as the page writes them, and `fix`: where it starts (products = the Products tab, settings = Settings › Integrations › Catalog). `channels` says for each AI channel (chatgpt-shopping, google-aio, google-aimode, gemini-web, copilot-web) whether the brand's products are on its shelves (showing), its shelves are read without them (notShowing), or it isn't tracked (notTracked). Needs a plan with Product Visibility (Growth and above): on Starter it answers plan_limit.",
inputSchema: {
brand_id: relaxedUuid.describe('Brand UUID, from list_brands.'),
period: periodInput,
diff --git a/web/src/lib/shopping/readiness.test.ts b/web/src/lib/shopping/readiness.test.ts
index 19debb1c0..1e81a4aad 100644
--- a/web/src/lib/shopping/readiness.test.ts
+++ b/web/src/lib/shopping/readiness.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, it } from 'vitest';
import type { CatalogSource } from '@/lib/catalog';
import { productRows, type CatalogProductRow } from './products';
-import { channelState, readinessChecklist } from './readiness';
+import { pageKey } from '@/lib/content/feed-match';
+import { channelState, readinessChecklist, type ShoppingSearchAppearance } from './readiness';
/** Product Visibility's Readiness (ECOM-015). */
@@ -42,6 +43,8 @@ describe('readinessChecklist', () => {
market: 'europe',
catalog: [source('feed_url'), source('merchant_center')],
merchantCenterOffered: true,
+ // Both product pages in Google's shopping results.
+ searchAppearance: { state: 'read', pages: rows.map((row) => pageKey(row.product.url)!) },
products: rows,
openAi: null,
cheaperResellers: 0,
@@ -50,6 +53,7 @@ describe('readinessChecklist', () => {
expect(items.map((item) => [item.key, item.state])).toEqual([
['catalog', 'pass'],
['merchantCenter', 'pass'],
+ ['googleShopping', 'pass'],
['firstWords', 'pass'],
['feedFields', 'pass'],
['feedLinks', 'pass'],
@@ -85,6 +89,7 @@ describe('readinessChecklist', () => {
market: 'us',
catalog: [source('feed_url')],
merchantCenterOffered: true,
+ searchAppearance: null,
products: rows,
openAi: { directFeed: false, ownCards: 3 },
cheaperResellers: 2,
@@ -121,6 +126,7 @@ describe('readinessChecklist', () => {
market: 'us',
catalog: [source('shopify')],
merchantCenterOffered: true,
+ searchAppearance: null,
products: productRows(products, [], []),
openAi: null,
cheaperResellers: null,
@@ -144,6 +150,7 @@ describe('readinessChecklist', () => {
market: 'europe',
catalog: [],
merchantCenterOffered: true,
+ searchAppearance: null,
products: null,
openAi: null,
cheaperResellers: null,
@@ -160,6 +167,7 @@ describe('readinessChecklist', () => {
market: 'europe',
catalog: null,
merchantCenterOffered: true,
+ searchAppearance: null,
products: null,
openAi: null,
cheaperResellers: null,
@@ -179,6 +187,7 @@ describe('readinessChecklist', () => {
cheaperResellers: null,
amazonDrop: null,
merchantCenterOffered: false,
+ searchAppearance: null,
};
it('neither lists nor scores it, in the US and in Europe', () => {
@@ -208,6 +217,68 @@ describe('readinessChecklist', () => {
});
});
});
+
+ describe("Google's shopping results (Search Console)", () => {
+ const rows = productRows(
+ ['a', 'b', 'c'].map((id) =>
+ product(id, { url: `https://www.shop.example/products/${id}/?utm_medium=feed` }),
+ ),
+ [],
+ [],
+ );
+ const check = (searchAppearance: ShoppingSearchAppearance | null, products = rows) =>
+ readinessChecklist({
+ market: 'us',
+ catalog: [source('feed_url')],
+ merchantCenterOffered: false,
+ searchAppearance,
+ products,
+ openAi: null,
+ cheaperResellers: null,
+ amazonDrop: null,
+ });
+ const item = (searchAppearance: ShoppingSearchAppearance | null, products = rows) =>
+ check(searchAppearance, products).items.find((i) => i.key === 'googleShopping');
+
+ it('passes from half the product pages shown, warns below, fails with none', () => {
+ expect(
+ item({ state: 'read', pages: ['shop.example/products/a', 'shop.example/products/b'] }),
+ ).toEqual({ key: 'googleShopping', state: 'pass', values: { count: 2, total: 3 } });
+ expect(
+ item({ state: 'read', pages: ['shop.example/products/c', 'shop.example/blog'] }),
+ ).toEqual({ key: 'googleShopping', state: 'warn', values: { count: 1, total: 3 } });
+ expect(item({ state: 'read', pages: [] })).toEqual({
+ key: 'googleShopping',
+ state: 'fail',
+ values: { count: 0, total: 3 },
+ });
+ });
+
+ it("doesn't know, nor scores it, without Search Console or before its first read", () => {
+ expect(item({ state: 'not_connected', pages: [] })).toEqual({
+ key: 'googleShopping',
+ state: 'unknown',
+ values: { reason: 'not_connected' },
+ action: 'settings',
+ });
+ expect(item({ state: 'not_synced', pages: [] })).toMatchObject({
+ state: 'unknown',
+ values: { reason: 'not_synced' },
+ });
+ expect(item(null)).toMatchObject({ state: 'unknown', values: { reason: 'unread' } });
+ // The catalog connected is the one scored check.
+ expect(check({ state: 'not_connected', pages: [] }).score).toBe(100);
+ const unlinked = productRows([product('a', { url: null })], [], []);
+ expect(item({ state: 'read', pages: [] }, unlinked)).toMatchObject({
+ state: 'unknown',
+ values: { reason: 'no_pages' },
+ });
+ });
+
+ it('is no check without products', () => {
+ expect(item({ state: 'read', pages: [] }, [])).toBeUndefined();
+ });
+ });
});
describe('channelState', () => {
diff --git a/web/src/lib/shopping/readiness.ts b/web/src/lib/shopping/readiness.ts
index 060c630c9..ef29f6da9 100644
--- a/web/src/lib/shopping/readiness.ts
+++ b/web/src/lib/shopping/readiness.ts
@@ -3,6 +3,7 @@ import type { ShoppingMarket } from '@/lib/shopping/markets';
import { openAiIndexStatus, type OpenAiIndexRead } from '@/lib/shopping/openai-index';
import type { ProductRow, ReadinessCheck } from '@/lib/shopping/products';
import { priceText } from '@/lib/shopping/price';
+import { pageKey } from '@/lib/content/feed-match';
/**
* Product Visibility's Readiness (ECOM-015, spec §3.4 / §3.4b): how ready
@@ -19,6 +20,7 @@ export type CheckState = 'pass' | 'warn' | 'fail' | 'unknown';
export type ReadinessKey =
| 'catalog'
| 'merchantCenter'
+ | 'googleShopping'
| 'openAiIndex'
| 'verifiedSeller'
| 'firstWords'
@@ -37,6 +39,19 @@ export interface ReadinessItem {
action?: 'products' | 'settings';
}
+/**
+ * The brand's pages Google showed as merchant listings or product snippets
+ * over the last 28 days (Search Console, 00377), by page key; or why it
+ * can't say: no property mapped, or not read yet.
+ */
+export interface ShoppingSearchAppearance {
+ state: 'not_connected' | 'not_synced' | 'read';
+ pages: string[];
+}
+
+/** At least this share of the products with a page shown passes; fewer, but some, warns. */
+export const SHOWN_PASS_SHARE = 0.5;
+
export interface ReadinessInput {
market: ShoppingMarket;
/** The brand's catalog sources; null when they couldn't be read. */
@@ -49,6 +64,8 @@ export interface ReadinessInput {
merchantCenterOffered: boolean;
/** The catalog's products; null without a catalog, or while unread. */
products: ProductRow[] | null;
+ /** Google's shopping results from Search Console; null when it couldn't be read. */
+ searchAppearance: ShoppingSearchAppearance | null;
/** OpenAI's product index (US); null when not read. */
openAi: OpenAiIndexRead | null;
/** Resellers cheaper than the brand in AI answers; null when not read. */
@@ -99,6 +116,29 @@ export function readinessChecklist(input: ReadinessInput): {
action: merchantCenter || input.catalog === null ? undefined : 'settings',
});
}
+ if (products.length) {
+ // The products with a page, as Search Console's pages are keyed.
+ const linked = new Set(products.flatMap((row) => pageKey(row.product.url) ?? []));
+ const search = input.searchAppearance;
+ if (!search || search.state !== 'read' || linked.size === 0) {
+ items.push({
+ key: 'googleShopping',
+ state: 'unknown',
+ values: {
+ reason: !search ? 'unread' : search.state === 'read' ? 'no_pages' : search.state,
+ },
+ action: search?.state === 'not_connected' ? 'settings' : undefined,
+ });
+ } else {
+ const shownPages = new Set(search.pages);
+ const shown = [...linked].filter((key) => shownPages.has(key)).length;
+ items.push({
+ key: 'googleShopping',
+ state: shown === 0 ? 'fail' : shown / linked.size >= SHOWN_PASS_SHARE ? 'pass' : 'warn',
+ values: { count: shown, total: linked.size },
+ });
+ }
+ }
if (input.market === 'us') {
if (input.openAi) {
const status = openAiIndexStatus(input.openAi);
diff --git a/web/src/types/supabase.ts b/web/src/types/supabase.ts
index 13fbc741d..3bcd75eda 100644
--- a/web/src/types/supabase.ts
+++ b/web/src/types/supabase.ts
@@ -769,6 +769,8 @@ export type Database = {
gsc_pages_backfill_from: string | null
gsc_pages_backfilled_property: string | null
gsc_property: string | null
+ gsc_shopping_property: string | null
+ gsc_shopping_synced_at: string | null
id: string
industry: string | null
insights_pinned_competitors: string[]
@@ -804,6 +806,8 @@ export type Database = {
gsc_pages_backfill_from?: string | null
gsc_pages_backfilled_property?: string | null
gsc_property?: string | null
+ gsc_shopping_property?: string | null
+ gsc_shopping_synced_at?: string | null
id?: string
industry?: string | null
insights_pinned_competitors?: string[]
@@ -839,6 +843,8 @@ export type Database = {
gsc_pages_backfill_from?: string | null
gsc_pages_backfilled_property?: string | null
gsc_property?: string | null
+ gsc_shopping_property?: string | null
+ gsc_shopping_synced_at?: string | null
id?: string
industry?: string | null
insights_pinned_competitors?: string[]
@@ -3387,6 +3393,53 @@ export type Database = {
},
]
}
+ gsc_shopping_page_stats: {
+ Row: {
+ appearance: string
+ brand_id: string
+ clicks: number
+ created_at: string
+ ctr: number
+ date: string
+ id: string
+ impressions: number
+ page: string
+ position: number
+ }
+ Insert: {
+ appearance: string
+ brand_id: string
+ clicks?: number
+ created_at?: string
+ ctr?: number
+ date: string
+ id?: string
+ impressions?: number
+ page: string
+ position?: number
+ }
+ Update: {
+ appearance?: string
+ brand_id?: string
+ clicks?: number
+ created_at?: string
+ ctr?: number
+ date?: string
+ id?: string
+ impressions?: number
+ page?: string
+ position?: number
+ }
+ Relationships: [
+ {
+ foreignKeyName: "gsc_shopping_page_stats_brand_id_fkey"
+ columns: ["brand_id"]
+ isOneToOne: false
+ referencedRelation: "brands"
+ referencedColumns: ["id"]
+ },
+ ]
+ }
gsc_query_stats: {
Row: {
brand_id: string