Developer guide

Conversion tracking from your code

Version 0.1 · Last updated: 16 November 2026

Meta finds more of the people who pay you when it can see who signs up, who reaches the important steps, and who pays. Your website's pixel sees some of that. Your servers see all of it: verified sign-ups, approvals, payments, renewals. This guide sends those steps to Iraa, which counts every one for you and forwards the allowed ones to Meta through the Conversions API.

It works for any business: a shop, a SaaS, a clinic, a course, or a lending app with an Android app, a backend, a website and an admin panel in separate repos and a 20-step funnel.

The short version

  1. Payments, no code. In Iraa, open Tracking for developers and connect Razorpay or Stripe. Each payment becomes a Purchase in Meta. Renewals never count twice.
  2. Everything else, about 10 minutes per repo. Run the setup tool on your repos. It maps your code on your machine, Iraa designs the tracking plan, and you get exact instructions (or ready edits) for each repo.
  3. Test, then go live. Send test events, watch them arrive, and let real traffic show which places fire.

Security: what leaves your machine and what doesn't

We built this so a careful security team can say yes.

NeverOnly this
Your source codeCode, comments, string values, config values, hostnamesNames of routes, handlers, screens and files, with line numbers. You see the exact file before anything is sent.
Secrets.env*, keys, certificates, keystores, google-services.json, credentials files: never even openedNothing. Path segments that look like tokens are replaced with :redacted, and the server redacts again.
Your reposNo commits, no pushes, no access to GitHub or your serversFiles written to an iraa-tracking/ folder. apply edits only on a new local branch, and you review the diff.
Your usersRaw emails, phones, names, addresses, IDs of documents. Iraa refuses events that contain them.SHA-256 hashes of email and phone, made on your server. Your own user id, hashed again before it reaches Meta.
Sensitive businessesLoan amounts, health details, page paths and custom events to MetaStandard events only, with no value. Every step is still counted for you inside Iraa.

1. Payments with no code

Razorpay

  1. In Iraa: Tracking for developers, Razorpay, Connect. Iraa shows a webhook URL and a secret.
  2. In Razorpay: Account & Settings, Webhooks, Add New Webhook. Paste the URL and the secret.
  3. Tick payment.captured and subscription.charged, then Create Webhook.

Stripe

  1. In Iraa: Stripe, Connect. Copy the webhook URL.
  2. In Stripe: Developers, Webhooks, Add endpoint. Paste the URL and pick checkout.session.completed and invoice.paid.
  3. Copy the Signing secret (whsec_…) and paste it in Iraa.

What counts. A paid one-off checkout or payment becomes Purchase with its value. The first charge of a subscription becomes Purchase and Subscribe. Renewals send nothing. By default only a customer's first payment counts as a Purchase, which is what helps Meta find new payers.

2. The setup tool, for every step of your funnel

Needs Node 18 or newer. Nothing to install: npx runs it from iraa.ai. The alias keeps the commands short.

export IRAA_KEY=iraa_sk_...          # from Iraa: Tracking for developers
alias iraa-setup="npx -y --package=https://iraa.ai/sdk/iraa-setup.tgz iraa-setup"
iraa-setup scan ./backend ./web ./android ./admin
iraa-setup plan      # shows what it sends, asks first
iraa-setup brief     # instructions and helpers per repo
iraa-setup test      # sends test events, shows them arrive
iraa-setup status    # counts per place in your code

scan

Reads the repos on your machine and writes iraa-tracking/map.json and REPORT.md. It finds:

Scan all your repos in one command so callers in the app are matched to routes in the backend.

plan

Sends map.json (after showing it to you) and gets back one tracking plan for all your repos:

brief and apply

brief writes iraa-tracking/<repo>/IRAA_AGENT.md: for each step in that repo, the file and line, the exact call in that repo's language, the allowed properties and the rules. Give it to your developer, or to your AI coding tool ("follow IRAA_AGENT.md"). It also writes a small helper for the stack (Node, Python, Java/Kotlin, PHP, Go, Ruby).

apply is optional. For Node and TypeScript backends it adds the calls itself, only where the handler is found without doubt, on a new local branch iraa/tracking. It never commits. Anything uncertain stays in the brief.

Many repos

One plan covers all of them. Two rules keep the data clean across apps:

3. The events API

Any language. Server to server only.

POST https://iraa.ai/api/dev/events
Authorization: Bearer $IRAA_KEY
Content-Type: application/json

{"events": [{
  "name": "CompleteRegistration",      // a step from your plan, or a Meta standard event
  "id": "signup.8812",                 // unique per action; reuse the browser's id to dedupe
  "time": 1794830000,                  // unix seconds, last 7 days
  "userId": "8812",                    // your id; hashed before Meta
  "emailSha256": "…", "phoneSha256": "…",  // lowercase-trimmed email, digits-only phone, SHA-256
  "value": 499, "currency": "INR",     // money steps only
  "url": "https://you.com/welcome", "ip": "…", "userAgent": "…", "fbp": "…", "fbc": "…",
  "source": {"repo": "backend", "point": "auth.verifyEmail"},
  "test": "AB12CD34"                   // optional, from a test session
}]}

The response has one result per event: sent (to Meta), held (counted, not sent, with the reason) or rejected (with the reason). Up to 100 events per call.

Browser details matter. Pass the IP, user agent and the _fbp/_fbc cookies from the user's request when you have them. For events with no request (a payment webhook, a loan approval job), Iraa uses the browser details it last saw for that hashed email or user id, so Meta can still match the person.

Node SDK

npm i https://iraa.ai/sdk/iraa-track.tgz

import { createIraa } from "@iraa/track";
const iraa = createIraa({ repo: "backend" });   // reads IRAA_KEY

// in your handler, after the step is really done:
iraa.track("CompleteRegistration", { id: `signup.${user.id}`, userId: user.id, email: user.email, req, point: "auth.verifyEmail" });

The SDK hashes email and phone before sending, reads IP, user agent and Meta cookies from req, batches, times out after 3 seconds and never throws. Without a key it does nothing, so local development stays quiet.

Other endpoints

CallWhat it does
GET /api/dev/planYour current tracking plan.
POST /api/dev/plan{"map": …} from the setup tool. Returns a new plan version.
POST /api/dev/testStarts a 30-minute test session. Returns {code} to put in events as test.
GET /api/dev/statusCounts per step and per place in your code for 7 days, and planned places that never fired.

4. Test, then let real traffic decide

  1. iraa-setup test sends one test event per step and shows each one arrive.
  2. Deploy. Watch Tracking for developers in Iraa: each step shows how many fired in 7 days, from which repo and place.
  3. Places that never fire are listed. They are usually old or unused code the scan couldn't rule out. Move the call, or leave it.
  4. Switch observe steps to live when they look right. Iraa's optimizer then aims at the deepest step with real volume, and moves up as more people reach the money moment.

Restricted businesses: finance, lending, insurance, health

Meta limits what these businesses may share. Iraa detects them from your business details and enforces the rules for you: only Meta's standard events are sent, with no value, no page path and no custom data. Steps like KYC or disbursal are counted inside Iraa and stay out of Meta. Your funnel report stays complete; Meta sees only what it allows.

Questions

Do I need the pixel too? Yes, keep it on your website. It catches visits and browsing; your server catches the steps that matter. Share event ids for steps both report.

Monorepo? Point scan at the folders of each app inside it.

Mobile apps? Report steps from the app to your own backend, which calls Iraa. For install ads, keep Meta's app SDK in the app.

Can I see what was sent? iraa-tracking/outbox.json is exactly what plan sends. Events you send are your own requests.

How do I stop it? Make a new key in Iraa (the old one stops at once) or remove the calls. Disconnect payments with one tap.

Questions or a security review? Write to security@iraa.ai.