agentleFS
bighadj22bighadj22/codflow/.agents/skills/meta-ads/SKILL.md

meta-ads

Skill338 starsChanged 2 months agoApache-2.0View on GitHub

Official Meta (Facebook) Pixel and Conversions API reference docs for CodFlow's tracking stack — standard events, event parameters, deduplication, advanced matching, test events, and best practices. Use whenever working on Meta Pixel integration, CAPI server events, conversion tracking, event deduplication, attribution, or reviewing PRs that touch tracking (cod-server/src/workflows/capi.ts, capi-helpers.ts, capi_event_log, theme01 pixel scripts, store_pixel_config).

14 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use google-ads.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • thatrebeccaraeSkill

    google-ads

    Google Ads platform expertise. Audit campaigns, keywords, audiences, bidding, and conversion tracking. Use when the user asks about Google Ads, PPC, search advertising, Performance Max, Shopping ads, display campaigns, YouTube ads, or paid search optimization.

    Also in 7 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ground first: Read the relevant reference file(s) above before writing or reviewing a single line of tracking code.

    line 77
  2. Distinctive:

    Keep the source header (URL + fetch date) on every file so staleness is auditable.

    line 105

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Meta Ads — Pixel & Conversions API Official Documentation

CodFlow's tracking stack (Meta Pixel in theme01 + Conversions API in cod-server) must always match Meta's official behavior. This skill vendors the official documentation so every change — ours or a contributor's — can be grounded against the real spec instead of guesses, blog posts, or AI memory.

Rule for agents and contributors: any tracking change must be verified against these docs before review. When replying to a tracking PR, read the relevant reference here first and cite it.

The docs (all unaltered official content, fetched from developers.facebook.com)

Pixel — browser side (fbq())

FileWhat it covers
references/pixel/pixel-overview.mdWhat the Pixel is, redundant setup with CAPI
references/pixel/pixel-get-started.mdInstalling the base code, the fbq queue
references/pixel/pixel-reference-standard-events.mdThe standard-event table — exact definitions of Purchase, Lead, InitiateCheckout, etc. + object properties. The source of truth for "which event is this action?"
references/pixel/pixel-conversion-tracking.mdFiring events on actions vs page load, purchase-confirmation-page pattern
references/pixel/pixel-advanced-matching.mdem, ph etc. customer params on fbq('init')
references/pixel/pixel-single-page-apps.mdSPA pitfalls (irrelevant to our full-page loads — know why)
references/pixel/pixel-custom-audiences.mdAudience creation from Pixel data
references/pixel/pixel-gdpr.mdGDPR/Limited Data Use reasoning
references/pixel/pixel-data-processing-options.md_fbp cookie + data processing options

Conversions API — server side (/events endpoint)

FileWhat it covers
references/conversions-api/capi-overview.mdWhat CAPI is, redundant setup recommendation
references/conversions-api/capi-get-started.mdSystem user tokens, access, first request
references/conversions-api/capi-using-the-api.mdEndpoint mechanics, payloads, batching, error handling
references/conversions-api/capi-parameters.mdParameters index
references/conversions-api/capi-server-event-parameters.mdevent_name, event_time, event_id, event_source_url, action_source — the per-event field contract
references/conversions-api/capi-customer-information-parameters.mdHashed ph, em, client_ip_address, client_user_agent, fbp, fbc — what we send and how it's normalized
references/conversions-api/capi-custom-data-parameters.mdvalue, currency, contents, content_ids, order_id, num_items
references/conversions-api/capi-original-event-parameters.mdOriginal-event dedup fields (aggregated/merged events)
references/conversions-api/capi-main-body-parameters.mddata[], test_event_code wrapper
references/conversions-api/capi-deduplication.mdPixel ↔ CAPI dedup: browser eventID must equal CAPI event_id AND names must match. The rule behind CodFlow's eventID = orderId pattern
references/conversions-api/capi-best-practices.mdMeta's recommended architecture, timing, and matching quality guidance
references/conversions-api/capi-verifying-setup.mdEvents Manager validation, Test Events
references/conversions-api/capi-offline-events.mdOffline conversion semantics (delayed events — the category our purchase-on-delivery model lives in)
references/conversions-api/capi-payload-helper.mdMeta's interactive payload builder (for debugging shapes)

How CodFlow maps onto these docs (quick orientation)

  • Browser: theme01's BaseHead.astro loads the canonical fbevents.js snippet (PageView on load); thank-you.astro fires the conversion event with { eventID: orderId } — the fourth fbq argument, per the dedup doc.
  • Server: cod-server/src/workflows/capi.ts (Cloudflare Workflow) sends the mirrored event via /events with event_id: orderId; capi-helpers.ts gates which status transitions trigger it; capi_event_log records what was sent (and powers idempotency).
  • Config: store_pixel_config (pixel id, access token, test event code, conversion event choice, test mode) — Settings → Tracking.
  • Dedup contract: browser eventID === CAPI event_id === orderId, same event_name on both sides. Any tracking change that breaks this equality double-counts conversions (see capi-deduplication.md).
  • Standard-event semantics: which CodFlow moment maps to which Meta event is governed by pixel-reference-standard-events.md — notably Purchase is defined as at-checkout ("lands on thank you or confirmation page") and Lead as a completed sign-up. COD purchase-on-delivery is an offline-style delayed Purchase (see capi-offline-events.md) — legitimate, but it must be a deliberate merchant choice, not a silent default.

Working rules for tracking changes

  1. Ground first. Read the relevant reference file(s) above before writing or reviewing a single line of tracking code. Cite the doc in the PR/review when a decision hinges on Meta behavior.
  2. Never break the dedup equality (browser eventID === server event_id, matching names) — silent double-counting or double-sending is the #1 tracking bug class.
  3. A new conversion-event mode must fire from BOTH sides (browser + CAPI mirror) or from exactly ONE side deliberately, never accidentally. PR #103's lesson: a mode that exists only in the settings enum is not a feature.
  4. capi_event_log is the idempotency ledger — anything that can fire twice (webhook retries, status toggles) must be guarded through it.
  5. Test Mode (test_event_code) exists for verification — use capi-verifying-setup.md's flow before claiming an event works.
  6. Docs are read-only reference. These files are unaltered Meta content (only a source header is prepended). Never edit them to match code — if code and docs disagree, the CODE changes (or Meta did, and we re-fetch).

Refreshing the docs

Meta updates its docs; when a tracking question can't be answered from these files (or the content looks outdated), re-fetch with Firecrawl:

firecrawl scrape "https://developers.facebook.com/documentation/<path>" --only-main-content

Keep the source header (URL + fetch date) on every file so staleness is auditable. Content below the header stays unaltered.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.