pex

Connectors Overview

Connectors bring external data into Apex — ad spend from your campaigns, deals from your CRM, payments from Stripe, and behavior data from analytics tools. Once connected, Apex uses this data for attribution, revenue matching, and experiment analysis.

How Connectors Work

Every connector follows the same pattern:

Authenticate

Most connectors use OAuth 2.0. You click Connect, authorize access on the platform's consent screen, and Apex stores the tokens securely. Microsoft Clarity uses an API key instead.

Select an account

For platforms with multiple accounts (ad accounts, properties, portals), you pick which one to sync.

Sync data

Apex pulls metrics for the configured date range. Syncs run automatically on a schedule and can be triggered manually from the Sensors page.

Use the data

Synced data feeds into the dashboard, attribution engine, and experiment analysis. Ad spend appears in channel breakdowns. CRM deals link to leads. Payments enable revenue attribution.

Connector Categories

CategoryConnectorsWhat They Provide
AdsGoogle Ads, LinkedIn Ads, Meta AdsCampaign spend, impressions, clicks, conversions
CRMHubSpotDeal pipeline, contact data, revenue attribution
PaymentsStripeCharges, refunds, subscriptions, actual revenue
AnalyticsGoogle Analytics, Microsoft ClaritySessions, pageviews, engagement, heatmaps

OAuth Flow

For OAuth connectors, the flow is:

  1. User clicks Connect on the Sensors page
  2. Apex redirects to the platform's authorization screen
  3. User grants access and is redirected back to /api/connectors/{type}/callback
  4. Apex exchanges the authorization code for access and refresh tokens
  5. Tokens are stored encrypted in the project's connector config

Apex handles token refresh automatically. When an access token expires, the framework refreshes it using the stored refresh token before the next sync.

Info

OAuth tokens are scoped to read-only permissions. Apex never writes data to your connected platforms.

Sync Process

Each sync pulls data for a date range (default: last 30 days). The sync process:

  1. Checks if the access token needs refreshing
  2. Calls the platform API to fetch metrics
  3. Normalizes the data into Apex's unified format
  4. Stores the results and updates the sync timestamp

Syncs include automatic retry with exponential backoff for transient errors. If a sync fails (expired token, revoked access, API error), the error is classified and displayed on the Sensors page.

Data Normalization

Each connector normalizes platform-specific data into a common structure:

  • Channel metrics — visitors, leads, conversion rate, cost, cost per lead
  • Raw data — platform-specific rows preserved for detailed analysis
  • Deals (CRM) — amount, stage, close date, contact email
  • Charges (Payments) — amount, currency, customer email, timestamp

This normalization enables cross-channel comparison and unified attribution.

Tip

Connect your ad platforms and payment provider together for the most valuable insight: which campaigns actually drive revenue, not just clicks.

Next Steps