Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Motivation
#577 established the org-level Google Search Console connection. Before any data can be pulled, the system must know which GSC property each brand corresponds to — a connected account routinely holds several properties (URL-prefix https://example.com/ and domain sc-domain:example.com forms), and everything in the data-pull follow-ups keys off this mapping.
Scope
1. Property listing (server)
GET /api/integrations/google-search-console/properties— executes the Search Consolesites.listtool through the existing Composio connection and returns the properties visible to the connected account (siteUrl,permissionLevel).- Reuses the org entity + connected account from Settings: Integrations tab + Google Search Console connection via Composio #577; requires the Composio API key to have tool-execution permission (the connect flow only needed
connected_accountswrite).
2. Brand → property mapping (persistence)
- New nullable column
brands.gsc_property(text) — the connection is org-level, the property choice is brand-level. A mapping table is overkill while each brand maps to exactly one property. - Migration as a numbered file under
supabase/migrations, plus the manualweb/src/types/supabase.tssync.
3. Auto-match + manual pick (UI)
- On the Integrations card (Settings → Integrations), once connected, list the org's brands each with a property select.
- Preselect automatically when a property matches the brand's domains:
sc-domain:<apex>or a URL-prefix whose host equals/ends with a brand domain. One match → preselect and save; several or none → leave the select empty for a manual pick. - Selection persists per brand and is editable later.
4. Status surfacing
- The GSC card's connected state shows per-brand mapping status (e.g. "2 of 3 brands mapped") so it's obvious when a brand still needs a pick.
Out of scope (follow-ups)
- Pulling
searchAnalytics.querydata and storing it (next issue — deterministic parameters, daily job). - Feeding prompt suggestions / search-vs-AI insights from that data.
Acceptance
- With a connected account holding multiple properties, each brand can be mapped to exactly one property; brands whose domain matches a property are premapped automatically.
- The mapping survives reloads and is visible to teammates (org-scoped read).
- Disconnecting the integration keeps the stored
gsc_propertyvalues (reconnecting restores functionality without re-picking). - Self-host without Composio env stays unaffected.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
feat: GSC property mapping and daily query-stats sync (#647)