Skip to content

GSC integration phase 2a: map each brand to a Search Console property #642

Closed

Description

@gkhngyk

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 Console sites.list tool 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_accounts write).

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 manual web/src/types/supabase.ts sync.

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.query data 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_property values (reconnecting restores functionality without re-picking).
  • Self-host without Composio env stays unaffected.

Activity

  1. added
    enhancement
    on Aug 4, 2026
  2. self-assigned this
    on Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions