Integration Contracts Explained

An integration contract is the core idea behind VibesAnalytics. Instead of asking your agent to "figure out analytics," you give it one structured JSON document that says exactly what to build. One MCP call in, one complete tracking blueprint out.

Why a contract

AI coding agents are good at writing code from a clear spec and bad at guessing tribal knowledge buried in five different ad dashboards. The integration contract turns "set up tracking" into a deterministic task: every event, every mapping, every env var is named explicitly, so the agent can implement it without marketing expertise.

What's inside

A contract returned by get_integration_contract includes:

  • Events — the canonical event taxonomy for your project (e.g. session_started, signup_completed, purchase_completed) with the properties each one carries.
  • Provider mappings — how each canonical event maps to every connected provider's event (e.g. purchase_completed → GA4 purchase, Meta Purchase, TikTok CompletePayment), including value/currency.
  • SDK setup — which SDKs/pixels to add and how to initialize them in your framework.
  • Env vars — the exact environment variables to inject (measurement IDs, pixel IDs, API keys).
  • Validation checklist — the checks that must pass before tracking is considered healthy.

How your agent uses it

  1. Call get_integration_contract for the project.
  2. Implement the events, SDKs, and env vars exactly as specified.
  3. Call validate_tracking to confirm everything fires and every provider is connected.

Because the contract is canonical-first, the same event taxonomy maps cleanly across providers — you instrument once and every connected platform receives the right event. See Normalized Metrics for how that same canonical layer powers reporting.