Central Ad Data Infrastructure

One Broker.
Every Ad Account.

Connect Google Ads, GA4, and Meta Ads once — sync normalized performance data to every RocketBoard tenant automatically.

3

Ad platforms

1

OAuth app per provider

Tenants supported

AUTO

Token refresh

Connect once, sync everywhere

The broker handles the entire OAuth lifecycle and data pipeline so your CRM tenants never touch provider tokens directly.

01

Tenant initiates OAuth

Your CRM calls POST /api/oauth/connect with a signed state containing the tenant key, company ID, and return URL. The broker generates a provider authorization URL.

02

Broker handles the callback

The user authenticates with Google or Meta. The provider redirects to the broker's single callback domain. Broker exchanges the code, stores tokens centrally, and discovers all linked ad accounts.

03

Assets discovered & synced

GA4 properties, Google Ads customers, Meta ad accounts, pages, and pixels are all upserted. Sync jobs are queued and processed immediately — tokens are auto-refreshed before every run.

04

Normalized data available

Performance rows land in marketing_performance_daily. Your CRM calls GET /api/overview to get spend, sessions, ROAS, leads, and campaigns — normalized across all providers.

All your ad data, one schema

Google Ads

google_ads

Campaigns, ad groups, ads, and daily performance at the ad level. Micros-to-currency conversion included.

  • Campaigns
  • Ad Groups
  • Ads
  • Daily spend & clicks
  • Conversions & ROAS

Google Analytics 4

ga4

Session-level campaign performance. Sessions, engaged sessions, key events, and revenue by date.

  • Sessions & engagement
  • Key events
  • Revenue
  • Campaign attribution
  • Bounce rate

Meta Ads

meta_ads

Full campaign structure with insight data at campaign, ad set, and ad level. Leads and purchase events parsed automatically.

  • Campaigns & Ad Sets
  • Ads + creatives
  • Impressions & reach
  • Leads & purchases
  • Conversion value

Infrastructure that stays out of the way

Automatic token refresh

Google tokens are refreshed 5 minutes before expiry and persisted back to the connection. No stale-token sync failures.

Signed OAuth state

Every OAuth flow uses HMAC-SHA256 signed state with a 15-minute expiry. Forge-proof, replay-proof.

Multi-tenant isolation

Company ID is baked into every token, asset, and performance row. One broker, isolated data per tenant.

Normalized data model

Spend, clicks, sessions, leads, ROAS — one schema regardless of whether the source is Google or Meta.

Raw payload archive

Every API response is stored verbatim in marketing_raw_payload for auditability and re-processing.

Sync jobs on connect

Assets are discovered and a backfill sync is queued and run immediately after each OAuth callback — no manual trigger needed.

Tokens stay in the broker. Always.

Tenant A

CRM / App

Tenant B

CRM / App

Tenant C

CRM / App

API key

Ads Broker

Central token store

OAuthSyncAnalyticsRaw payloads

OAuth tokens

Google Ads

GA4

Meta Ads

Provider access tokens are stored only in the broker's Supabase database. Tenant apps authenticate using an API key and never receive OAuth tokens directly.

Simple REST, sensible responses

All broker-facing endpoints require x-broker-api-key header.

GET/api/health
GET/api/oauth/providers
POST/api/oauth/connect
GET/api/oauth/:provider/callback
GET/api/connections
POST/api/connections/create
POST/api/assets/create
POST/api/sync-jobs/create
POST/api/sync-jobs/run
GET/api/overview
GET/api/raw-payloads