Data sources overview

What the data sources page does, the connection matrix for every source, what each state means, and the actions available.

Overview#

The data sources page (`/dashboard/data-sources`) shows each source's connection state and bound value, with entries to authorize or disconnect. The connection model is "account-level authorization + site-level binding".

  • Connection status reads real site-record fields (such as `ga4_property_id`, `gsc_site_url`, `adsense_client_id`).
  • Authorization uses a one-time connect ticket then a full-page redirect; disconnect goes through `auth/disconnect`.
  • There is no plan gating.

Connection matrix#

Each source's state, permission, bound value and latency:

SourceStatePermissionBound valueLatency
GA4Connected / unboundanalytics.readonly (read)GA4 property24-48 hours
GSCConnected / unboundwebmasters (read + write)GSC property1-2 days
AdSenseConnected / unboundadsense.readonly (read)Account `pub-xxx`24-48 hours
GTMConnected / unboundtagmanager.readonly (read)Container `accounts/x/containers/y`Read on demand
BingConnected / unboundwebmaster.readonly (read)Bing siteDaily
CloudflareConnected / unboundAPI Token (read)Cloudflare zoneNear realtime (history 14/30 days)
PageSpeed InsightsAlways availableNo authorization—~6 hours

State meanings#

  • Connected: the site has bound a concrete resource for that source and can fetch data.
  • Unbound: the account is authorized but the site has not selected/bound a resource yet — pick one in Settings.
  • Invalid: the authorization token has expired or lacks scope, and needs re-authorization.
  • Always available: does not depend on account authorization; usable as long as the server has outbound access (PSI).

Common error codes when fetching fails:

CodeMeaning
CONNECTION_REQUIRED403, that service is not connected
GOOGLE_AUTH_REQUIRED503, token expired, re-authorization required
TOKEN_REFRESH_FAILED503, token refresh failed
GA4_NOT_BOUND / NO_GA4_PROPERTYNo GA4 property selected (unbound)
NO_GSC_PROPERTYGSC property not bound
GSC_PERMISSION_DENIED403, wrong property type or no permission
NO_ADSENSE_ACCOUNTAdSense account not bound
ADSENSE_MULTIPLE_ACCOUNTSMultiple AdSense accounts; a manual pick is required
PSI_UNAVAILABLE_OR_QUOTAQuota exhausted or timed out
UPSTREAM502, upstream error
PLAN_REQUIRED403, plan too low
BILLING_NOT_CONFIGURED503, billing not configured
AI_NOT_CONFIGURED503, model not configured
CF_TOKEN_INVALID400, invalid Cloudflare Token

Available actions#

Actions available per source, by state:

  • Re-authorize: after a scope upgrade or an expired token, run authorization again (GSC URL Inspection needs write scope).
  • Change binding: pick another resource in Settings — no re-authorization needed.
  • Disconnect: only that service's grant is revoked; Bing / Cloudflare are fully independent and never affect other sources.
Note: AdSense is account-level: a single account is selected automatically and multiple accounts must be picked manually. Cloudflare requires the site to be hosted on Cloudflare to bind a zone.
  • Site connections & authorization: /connections
  • API keys & API access: /api-keys
  • Plans & feature gating: /plans