Meta Ads CAPI Setup

v1.0.0

[Didoo AI] Step-by-step guide for setting up Meta Conversions API (CAPI) — server-side event tracking that improves conversion measurement accuracy and reduc...

0· 92·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for elias-didoo/meta-ads-capi-setup.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Meta Ads CAPI Setup" (elias-didoo/meta-ads-capi-setup) from ClawHub.
Skill page: https://clawhub.ai/elias-didoo/meta-ads-capi-setup
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install meta-ads-capi-setup

ClawHub CLI

Package manager switcher

npx clawhub@latest install meta-ads-capi-setup
Security Scan
Capability signals
CryptoCan make purchasesRequires OAuth tokenRequires sensitive credentials
These labels describe what authority the skill may exercise. They are separate from suspicious or malicious moderation verdicts.
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The skill name/description (Meta Ads CAPI setup) matches the SKILL.md content. The guide sensibly describes obtaining a Meta System User access token and Pixel ID — these credentials are appropriate and expected for CAPI setup.
Instruction Scope
The instructions stay on-topic: choosing integration method, generating system user tokens, configuring events, testing, and verifying matching quality. The guide does not instruct reading unrelated system files or exfiltrating data to third-party endpoints beyond Facebook's Graph API.
Install Mechanism
This is an instruction-only skill with no install spec and no bundled code — nothing is written to disk or downloaded during installation.
Credentials
The guide clearly describes using a System User access token with scopes like ads_management and business_management, which are appropriate for Meta Marketing API calls. The registry metadata, however, declares no required env vars/primary credential — this is not harmful but is a mild inconsistency: the skill documents credentials users must obtain manually but does not itself request them from the agent environment.
Persistence & Privilege
Skill flags are default (always: false, user-invocable true). There is no persistent or privileged installation behavior described.
Assessment
This guide looks legitimate for configuring Meta CAPI. Before following it: 1) Treat the System User access token like a high‑privilege secret — store it in a secure vault, rotate it regularly, and grant least privilege. 2) Only provide the token to trusted systems or integrations; do not paste it into untrusted web forms or chat. 3) If you lack developer resources, prefer an official partner integration (Shopify, WooCommerce, GTM server-side) rather than direct API calls. 4) Ensure you hash PII (SHA‑256) client-side or server-side as Meta requires and verify privacy/compliance requirements (GDPR/CCPA) before sending user identifiers. 5) The registry metadata doesn’t declare required env vars even though the guide describes credentials — that’s informational only, not a runtime requirement of the skill itself. If you want deeper assurance, ask the publisher for the full, untruncated SKILL.md and confirm there are no hidden install steps or code files.

Like a lobster shell, security has layers — review code before you run it.

capivk97370kk98xh63n1c9pct4dpw184tdhjconversions-apivk97370kk98xh63n1c9pct4dpw184tdhjdidoo-aivk97370kk98xh63n1c9pct4dpw184tdhjlatestvk97370kk98xh63n1c9pct4dpw184tdhjmeta-adsvk97370kk98xh63n1c9pct4dpw184tdhjtrackingvk97370kk98xh63n1c9pct4dpw184tdhj
92downloads
0stars
1versions
Updated 1w ago
v1.0.0
MIT-0

Meta Ads CAPI Setup Guide

Required Credentials

CredentialWhere to GetUsed For
META_ACCESS_TOKENMeta Developer Console → Graph API Explorer → Generate TokenAll Meta Marketing API calls
META_PIXEL_IDMeta Events Manager → select your Pixel → copy Pixel IDIdentifying which pixel to configure

Token note: The System User access token (generated in Business Settings) is the primary credential for CAPI API calls. You still need a registered Meta App (App ID) to set up the CAPI integration in Events Manager — the App ID is required when creating the System User and configuring token permissions. Make sure the token includes these scopes: ads_management, business_management, pages_read_engagement.


When to Use

When setting up tracking for a new account, or when CPA shown in Meta Ads Manager is significantly higher than actual leads/sales (indicating a tracking gap). CAPI is especially critical for lead generation campaigns where offline conversions are the true business outcome.


What CAPI Does (vs Pixel Only)

  • Pixel only: Browser-based. Tracks users who click your ad and then take action on your website. Misses users who convert on different devices, after clearing cookies, or without clicking.
  • CAPI: Server-to-server. Sends conversion events directly from your server to Meta. More accurate, more reliable, harder to block.

Together: Pixel + CAPI gives Meta the most complete picture → better optimization → lower CPA over time.

If you're not using CAPI, you're likely overpaying for every lead. The gap can be 20–50% depending on industry and browser mix.


Prerequisites

Before setting up CAPI, you need:

  1. Meta Pixel installed on your website
  2. A Meta App registered at developers.facebook.com (App ID required to configure CAPI in Events Manager)
  3. A server environment that can send HTTP requests (or a partner integration like Shopify, WooCommerce, Zapier, or Google Tag Manager Server-side)
  4. Access to your Meta Business Manager with pixel-level permissions

Step 1: Choose Your Integration Method

Recommended for Most SMBs — Native Platform Integration

Use your e-commerce platform's built-in Meta integration. This is the easiest path:

PlatformHow to Connect
ShopifyShopify Admin → Sales Channels → Meta
WooCommercePlugins → Meta for WooCommerce
Other platformsCheck Meta's partner directory at meta.com/partners

Steps (native integration):

  1. Go to Meta Events Manager → select your Pixel
  2. Click "About CAPI" → "Get Started"
  3. Select your platform from the partner list
  4. Follow the on-screen prompts to authorize the connection
  5. Select which events to send (see Step 3 below)

Advanced — Manual Integration Options

Only use these if you are a developer or using a platform without native Meta integration.

MethodBest ForComplexity
Google Tag Manager Server-SideTeams already using GTMMedium
Zapier / Make.comNo-code teams, non-standard tech stacksMedium
Meta Conversions API via Meta Business ManagerSimple server events without developer resourcesLow
Direct API IntegrationDevelopers building custom infrastructureHigh

For Direct API: use your META_ACCESS_TOKEN to send events to https://graph.facebook.com/v21.0/{pixel_id}/events.


Step 2: Generate a System User Access Token

  1. Go to Meta Business Manager → Business Settings → System Users
  2. Create a new system user with "Analytics" or "Ads" permissions
  3. Generate an access token with: ads_management, business_management, pages_read_engagement
  4. Save this token securely — you'll need it for all API calls

Step 3: Configure Which Events to Send

  1. Go to Meta Events Manager → select your Pixel
  2. Click "About CAPI" → "Get Started"
  3. Select your integration method
  4. Configure which events to send:
EventRecommended For
PageViewAll campaigns — helps Meta build audience
ViewContentE-commerce product pages
AddToCartE-commerce
PurchaseE-commerce (critical — this is your conversion event)
LeadLead generation (critical — matches your optimization goal)
CompleteRegistrationWebinar, courses, freemium signups
ContactLocal service businesses

Step 4: Test Your CAPI Connection

In Meta Events Manager:

  1. Select your pixel → "Test Events" tab
  2. Trigger the events on your website (submit a form, complete a purchase, etc.)
  3. Check that events appear in the test panel within seconds

What to verify:

  • Events are arriving with Deduping source confirmed (CAPI and Pixel aren't double-counted)
  • Event IDs are being passed (for deduplication)
  • Parameter completeness — more parameters = better optimization

Event parameters that improve CAPI quality:

  • event_id — unique ID per event, enables deduplication
  • user_data — email, phone, country (hashed with SHA-256)
  • custom_data — value, currency, content_name, content_category

Step 5: Verify CAPI Is Working Correctly

In Meta Events Manager, check:

  1. Event Quality Score — should be "Active" with green status
  2. Matching Quality — how many user parameters Meta can match to real users
  3. No significant gap between pixel events and CAPI events

Matching Quality benchmarks:

  • 7+ parameters with good hash quality → Excellent
  • 5–6 parameters → Good
  • < 5 parameters → Poor — optimize your event setup

Step 6: Standard Events vs. Custom Events

Standard Events (Preferred)

Meta's predefined event names: Lead, Purchase, PageView, ViewContent, AddToCart, InitiateCheckout, CompleteRegistration. Better optimization because Meta knows exactly what the event means.

Custom Events

Use only when no standard event fits. Define custom name and parameters yourself. Required for: offline sales, phone calls, specific business workflows.


CAPI Common Issues and Fixes

IssueLikely CauseFix
CAPI events not appearing in MetaToken expired or permissions wrongRegenerate access token with correct permissions
Huge gap between pixel and CAPI volumesCAPI not connected properlyCheck Events Manager → CAPI status
CPA artificially high in MetaCAPI not sending offline conversions (lead gen)Verify Lead event is firing server-side
Events marked as "Unmatched"User data not being passed correctlyEnsure email/phone is hashed before sending
Duplicate events (double counting)Both pixel and CAPI firing without deduplicationPass event_id in both pixel and CAPI calls

Lead Generation — CAPI Is Especially Critical

For lead gen campaigns, the conversion happens offline — someone fills out a form, you call them, they sign up. Meta pixel can't see this.

What CAPI must send for lead gen:

  1. Lead event when form is submitted (server-side, not just pixel)
  2. Lead event when you mark a lead as qualified in your CRM (offline → Meta)
  3. Revenue data if possible (even approximate) — helps Meta optimize for quality

CRM Integrations that support CAPI for leads: HubSpot, Salesforce, Zapier, Make.com.

If you're not sending offline lead data back to Meta: Meta is optimizing for form submissions only. You're paying for leads that never convert.


Event Deduplication — Preventing Double Counting

When both Pixel and CAPI send the same event (same event_id), Meta deduplicates automatically. Requirements:

  • Same event_id in both pixel and CAPI call
  • Same event_name
  • Events fired within the same 48-hour window
  • Same user data (at least one: email, phone, client_ip, client_user_agent)

Security Notes

  • Access tokens for CAPI should be treated like passwords — store in environment variables, never in code repositories
  • Use HTTPS for all CAPI calls
  • Hash PII (email, phone) using SHA-256 before sending to Meta

Comments

Loading comments...