First-party app
Meta Conversions API

Meta Conversions API

Send server-side conversion events to a Meta dataset (pixel) through the Meta Conversions API, with Meta's required SHA-256 customer-data hashing applied in-app.

stable MarketingAnalytics & BISocial Media

About

Meta Conversions API ships in the w6w first-party pack. It declares 5 actions, 2 health checks, and the host runs its code in a sandbox that never sees the credential.

App id
io.w6w.facebook-conversions
Version
0.1.2
Author
w6w
Licence
MIT
Categories
Marketing · Analytics & BI · Social Media

Overview

Meta’s Conversions API lets a business report conversions — purchases, leads, sign-ups — directly from its own server rather than relying on browser-side pixel tracking, and this app sends those events to a Meta dataset (pixel) on a business’s behalf.

Customer-matching fields like email and phone are normalized and SHA-256 hashed automatically before they leave this app, following the same rules Meta’s own SDKs apply, so a workflow can pass a plain email address without hand-rolling the hashing itself. Both a single-event and a batched send are available, and dataset-quality and diagnostics reads let a workflow check how well its events are matching Meta’s own audience data after the fact.

This app is deliberately narrow: it is the write path for one specific product, Meta’s Conversions API, and does not touch Facebook Pages content or Lead Ads — those are separate integrations with separate credentials. A health check reports live quota headroom against Meta’s own usage meters, since Meta publishes no general status feed for this API.

Build with Meta Conversions API

Three routes to the same 5 actions. The Workflow tab is generated from Meta Conversions API's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.

Get Dataset

get-dataset

Read a dataset (pixel) — name, creation time and when it last received an event. Requires ads_read.

Get Dataset Quality

get-dataset-quality

Read Event Match Quality, event coverage, deduplication and freshness metrics for a dataset.

List Dataset Diagnostics

list-diagnostics

Run Meta's dataset diagnostic checks — missing event parameters, delivery decline — scoped to server events by default.

Send Conversion Event

send-event

Send one server-side event to a Meta dataset. Customer data is normalised and SHA-256 hashed before it leaves this app.

Send Conversion Events (Batch)

send-events

Send up to 1000 server-side events in one request. Each event's user_data is normalised and SHA-256 hashed before it leaves this app.

A workflow step names the app and the action, and the editor fills in the connection when you pick one. This is the Step shape from the workflow spec, carrying Meta Conversions API's real ids.

{
  "manifestVersion": "2",
  "name": "facebook-conversions-example",
  "steps": [
    {
      "id": "send-event",
      "uses": {
        "app": "io.w6w.facebook-conversions",
        "action": "send-event",
        "connection": "conn_YOUR_CONNECTION_ID"
      },
      "with": {
        "eventName": "<eventName>",
        "actionSource": "<actionSource>"
      }
    }
  ]
}

Here are some of the things you can do

  • Send Conversion Event

    perform
    send-event
  • Get Dataset

    read
    get-dataset
  • Get Dataset Quality

    read
    get-dataset-quality
  • List Dataset Diagnostics

    read
    list-diagnostics
  • Send Conversion Events (Batch)

    perform
    send-events

Every app-specific value here is a blank you have to fill in. An app action is reached through the connection that authenticates it, so the address is a connection id, not the app id — and connections belong to your account, so a public page cannot know yours. Create one for Meta Conversions API, then fill in the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the parameters that action declares. The call itself is real — the shape is transcribed from the studio's own snippet builder, which prints the same kind of blanks — but nothing in it is specific to Meta Conversions API. The Workflow tab is where this app's real ids are.

Install
npm install @w6w/sdk
yarn add @w6w/sdk
pnpm add @w6w/sdk
deno add npm:@w6w/sdk
Code
import { W6wClient, isActionRun } from "@w6w/sdk";

// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();

const envelope = await client.run({
  urn: "conn_YOUR_CONNECTION_ID",
  action: "send-event",
  payload: {
    // datasetId: "<value>",
    eventName: "<value>",
    actionSource: "<value>",
    // eventTime: "<value>",
    // eventSourceUrl: "<value>",
    // eventId: "<value>",
    // userData: "<value>",
    // value: "<value>",
    // currency: "<value>",
    // customData: "<value>",
    // hashing: "<value>",
    // userDataExtra: "<value>",
    // testEventCode: "<value>",
    // optOut: "<value>",
    // dataProcessingOptions: "<value>",
    // dataProcessingOptionsCountry: "<value>",
    // dataProcessingOptionsState: "<value>",
  },
});

if (isActionRun(envelope)) console.log(envelope.value);
Install the CLI
npm install -g @w6w/cli
CLI
w6w run conn_YOUR_CONNECTION_ID --action send-event --payload '{"eventName":"<value>","actionSource":"<value>"}'

Give an AI agent Meta Conversions API — without giving it Meta Conversions API's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.

One tool call
{
  "name": "w6w_invoke",
  "arguments": {
    "ref": "app:io.w6w.facebook-conversions#send-event",
    "input": {
      "eventName": "<eventName>",
      "actionSource": "<actionSource>"
    }
  }
}

Every tool names its target with a single ref. The app: form above doesn't name a connection at all — the host resolves which of the caller's Meta Conversions API connections to sign with, and refuses rather than guesses when the answer is ambiguous.

What the agent gets

Credentials it can't read

The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.

A tool surface scoped to the caller

Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.

A durable workflow in one call

Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.

Health-aware discovery

Meta Conversions API's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.

The MCP surface is part of the hosted platform. Meta Conversions API itself is MIT, and the runtime that executes it is source-available (FSL).

Request MCP access

Health checks

Meta Conversions API declares its own checks, so its health is a property of the app rather than something the host guesses at.

service

Meta platform status

quota

API usage headroom

Percentage of the app's call-count, CPU-time and total-time allowances consumed, read off `X-App-Usage` and `X-Business-Use-Case-Usage`. Meta throttles when any meter reaches 100.