Documentation
Introduction
Connect Meta ad spend to the leads, bookings, customers and revenue your own records confirm.
Realanalytics follows each lead after the click: to a qualified enquiry, a booked call and a sale. Outcomes come from your CRM, payment system or server, not from a browser pixel alone. You can then send selected, verified outcomes back to Meta.
Setup needs a developer. This documentation is for that person. After setup, the team reads the reports in the app without writing code.
How setup works
- Track the website. Install the browser SDK and connect your consent manager. See Browser & Consent.
- Record verified outcomes. Connect Attio or Stripe, or report outcomes from your server. See Conversions & Revenue.
- Connect Meta. Import spend, keep stable campaign IDs and choose which stages to send back. See Meta Project Setup.
- Check the first report. Match a few real outcomes to your records, then compare campaigns.
Definitions live in code
Stages, attribution rules and Meta mappings are TypeScript in your repository. They get pull-request review and Git history, and the CLI shows a plan before anything changes.
import { defineAttribution } from '@realanalytics/sdk'
export const attribution = defineAttribution({
id: 'northside-dental',
model: 'last_paid',
lookbackWindowDays: 30,
conversionEvents: { lead_submitted: { stage: 'lead' } },
destinations: { meta: true, google: false },
meta: { stages: ['qualified_lead', 'booked_call', 'customer'] },
})npx --no-install realanalytics lint
npx --no-install realanalytics deploy --dry-runNext steps
- Quick Start: set up a project
- Installation: install the SDK and CLI packages
- Meta Project Setup: from one landing page to a report with spend and verified outcomes
- CLI Commands: the full CLI reference