Custom CRM
For a CRM we don't integrate with out of the box: an in-house system, clinic software, anything your team built. When a lead becomes qualified or a deal is won, your CRM sends one HTTPS request. AdsPing ties it back to the ad and reports it to the ad platforms.
Which path do I need?
It depends on where the lead started. Many businesses use both: one call per stage change, sent to whichever endpoint matches the lead.
| The lead started as… | Use | Your CRM sends |
|---|---|---|
| A message from a Click-to-WhatsApp ad, on a WhatsApp number connected to AdsPing | A. CRM webhook | Phone number + stage name |
| A form on your website or landing page, or any lead that visited your site | B. Event API | Event name + customer details + the ad click saved with the lead |
A. Leads from WhatsApp: CRM webhook
A customer clicks your Click-to-WhatsApp ad and messages you. AdsPing records the conversation together with the ad click. When your team later moves that customer's deal, for example from Appointment booked to Closed Won, your CRM posts the phone number and the new stage. AdsPing finds the conversation, attaches the ad click and reports the conversion to Meta. Your CRM never needs cookies, pixel IDs or ad click IDs.
Get your webhook URL
Account owner · Integrations → WhatsApp.
Open your pixel, then Integrations → WhatsApp. Under Feed conversions back from your CRM, click Create webhook endpoint and copy the Webhook URL. There is no separate API key: the key is the last part of this URL and works like a password, so share the URL with your developer privately.
The card appears once a WhatsApp number is connected. It is hidden when a built-in CRM is connected to the same pixel, because that CRM already reports the stages.
Send every stage change
Developer · one POST per change.
Whenever a deal changes stage, your CRM's server sends the request in the developer reference. Send every change: AdsPing ignores the stages you haven't mapped, so the CRM doesn't need to filter.
Map your stages
Account owner · the same card.
Ask your developer for the exact stage names the CRM sends. Under Stage mapping, click Add row for each stage that matters, type its name exactly as the CRM spells it and pick the event:
- Lead: a new inquiry. Skip it if every WhatsApp conversation already counts as a lead.
- Qualified lead: booked an appointment, showed up, passed your sales check.
- Purchase: paid. Turn on Optimization for this one, so Meta optimizes for paying customers. Only one stage can be the optimization event.
Use value sends the deal amount from the request. LTV × multiplies it, for example 3 when a first payment is usually a third of what a customer spends. Click Save mapping. Stages you don't map, such as Lost, are never sent.
Test it
Message your own number, then move a deal.
Message your WhatsApp number from a test phone, create a deal for that number in your CRM and move it to a mapped stage. Within a minute the call shows under Recent calls from your CRM on the same card, and the conversion appears in your WhatsApp activity. A test message doesn't come from an ad, so it carries no ad click. That link appears with real ad conversations.
A. Developer reference
POST https://api.adsping.io/api/v1/webhooks/feedback/YOUR_KEY
Content-Type: application/jsonNo other headers and no signature: the key in the URL authenticates the call. Keep the URL in a server-side environment variable, never in browser code, git or logs.
| Field | Type | Required | Description |
|---|---|---|---|
stage | string | yes | The deal's new stage, spelled exactly as mapped in AdsPing. |
phone | string | one of these three | The customer's WhatsApp number with country code, e.g. +90 532 123 45 67. The best match key. |
externalId | string | one of these three | Your CRM's ID for the lead or deal. |
email | string | one of these three | The customer's email. Also improves match quality. |
value | number | on sales | Deal amount as a JSON number, e.g. 1200, not "1200". |
currency | string | with value | ISO 4217 code: USD, EUR, TRY… |
firstName, lastName, city, state, zip, country | string | no | Hashed before they reach Meta. Each one improves match quality. |
curl -X POST 'https://api.adsping.io/api/v1/webhooks/feedback/YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{
"phone": "+90 532 123 45 67",
"stage": "Closed Won",
"value": 1200,
"currency": "USD",
"externalId": "deal-4821",
"email": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"country": "TR"
}'How AdsPing handles the call
- Matching: AdsPing looks for the WhatsApp conversation by phone first, then by
externalId, then by email, and takes the most recent one. - A 60-second pause: a stage change waits 60 seconds before it is sent. If the deal moves again in that minute, only the last stage counts. A wrong drag in the CRM never reaches Meta.
- Once per stage: each lead reports each event (Lead, Qualified lead, Purchase) to Meta once. Repeats and reopened deals are ignored, so retries are safe.
- Event names at Meta: Lead arrives as
LeadSubmitted, the others under their own names, as WhatsApp conversions with the ad click attached.
Responses
The webhook answers as soon as the call is safely queued. The outcome of processing is shown in the panel, not in the response.
| Response | Meaning | What to do |
|---|---|---|
200 {"received":true} | Accepted and queued. | Nothing. Check Recent calls in the panel. |
503 | Temporarily unavailable. Comes with Retry-After: 60. | Retry the same body later. |
413 | Body larger than 10 MB. | Send only the fields above. |
Recent calls from your CRM lists the last 50 calls with their result. Phone numbers and emails are masked there.
| Result in the panel | Meaning |
|---|---|
| Sent | Matched and queued for Meta. It goes out after the 60-second pause. |
| No matching WhatsApp lead | No conversation with this number on a connected WhatsApp number, or the phone is missing its country code. |
| Stage not mapped | Ignored on purpose. Click Map stage next to it to start sending it. |
| Already sent | This stage is already waiting for this lead. |
| No phone, email or id | The body has none of the three match keys. |
| Body not understood | A field has the wrong type, usually value sent as a string. |
B. Leads from your website: Event API
For leads that come in through a website form, your CRM reports the outcome to the same pixel your website uses. AdsPing forwards it to every ad platform connected to that pixel: Meta, Google Ads, TikTok, GA4 and others.
Keep the ad click with the lead
Website · once, in your form.
The ad platforms credit a sale to an ad through its click ID. Save the click IDs in hidden form fields, so they travel with the lead into your CRM:
// On your website form, before submit: keep the ad click with the lead.
function cookie(name) {
const m = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)"));
return m ? decodeURIComponent(m[1]) : "";
}
const q = new URLSearchParams(location.search);
form.querySelector('[name="fbc"]').value = cookie("_fbc");
form.querySelector('[name="fbp"]').value = cookie("_fbp");
form.querySelector('[name="gclid"]').value = q.get("gclid") || "";
form.querySelector('[name="ttclid"]').value = q.get("ttclid") || "";Store them on the CRM contact or deal. Missing click IDs aren't fatal: when you also send email or phone, AdsPing looks up the same person's earlier visits and fills in the Meta cookies, IP and browser on its own. Real click IDs still match best.
Send the stage change from your CRM
Developer · one POST per event.
When a lead qualifies or a deal is won, your CRM's server sends the request in the developer reference. There is no API key on this path: the request names your pixel by its ID. Find it under Pixels, in the pixel's ⋯ menu → Copy pixel ID. It is also the data-pixel-id value in your website's install code.
Watch it arrive
Account owner · Events.
Open Events in your dashboard. The event appears within seconds, with each ad platform it was delivered to. Check there, not the HTTP status: see the response notes below.
B. Developer reference
POST https://api.adsping.io/api/v1/t/YOUR_PIXEL_ID
Content-Type: application/json
User-Agent: AcmeCRM-AdsPing/1.0
Origin: https://acme.com- User-Agent: name your integration, e.g.
AcmeCRM-AdsPing/1.0. Generic agents such ascurl/8.x,python-requestsor Node's defaultundici, and any containing bot, crawl, spider, headless or http, are treated as bots. Events that carry an order ID and the customer's email or phone are always kept, but other events are dropped. - Origin: required when the pixel has allowed domains. Use one of them, e.g. your website address.
curl -X POST 'https://api.adsping.io/api/v1/t/YOUR_PIXEL_ID' \
-H 'Content-Type: application/json' \
-H 'User-Agent: AcmeCRM-AdsPing/1.0' \
-H 'Origin: https://acme.com' \
-d '{
"eventName": "Purchase",
"eventId": "acme-deal-4821-won",
"eventTime": 1793650000,
"actionSource": "system_generated",
"orderId": "deal-4821",
"email": "[email protected]",
"phone": "+15551234567",
"firstName": "Jane",
"lastName": "Doe",
"externalId": "contact-987",
"fbc": "fb.1.1793640000000.IwZXh0bgNhZW0BMABhZGlk...",
"fbp": "fb.1.1793640000000.1234567890",
"gclid": "Cj0KCQjw...",
"customData": { "value": 1200, "currency": "USD" }
}'| Field | Required | Description |
|---|---|---|
eventName | yes | Purchase, Lead, CompleteRegistration, Schedule, Contact… Case-sensitive. |
eventId | yes | Stable per conversion, built from the CRM record, e.g. acme-deal-4821-won. Two events with the same id count once. |
eventTime | recommended | Unix seconds when it happened. Up to 7 days in the past. Defaults to now. |
actionSource | recommended | system_generated for CRM outcomes. |
orderId | on sales | Your deal or order number. Google Ads also deduplicates on it. |
customData.value | on sales | Amount as a number. |
customData.currency | with value | ISO 4217 code. |
email, phone | strongly | Plain text or SHA-256. Hashed before they leave AdsPing. Phone with country code. |
firstName, lastName, city, zipCode, country, externalId | no | Each one improves match quality. |
fbc, fbp, gclid, gbraid, wbraid, ttclid, msclkid, sccid | when you have them | The click IDs saved with the lead in step 1. |
Responses
| Response | Meaning |
|---|---|
201 | Accepted and queued. The body echoes your eventId. |
400 | Malformed body, e.g. no eventName. |
403 | Origin missing or not one of the pixel's allowed domains. |
404 | Wrong pixel ID. |
429 | Over a rate limit. Slow down and retry. |
Limits: 30 requests per minute from one IP to one pixel. When you backfill old deals, send about one every two seconds. The full field list is in the Event API reference.
Which stages to send
- Send the sale. Purchase with its value is the signal that teaches the ad platforms which clicks become customers. It matters more than anything else.
- Add one step before it when sales take weeks: a qualified lead, an appointment that showed up, a signed quote. Ad platforms learn faster from an event that happens within a few days.
- Skip stages that mean nothing about quality, such as Contacted or No answer, and never send Lost as a conversion.
Test and troubleshoot
| What you see | Likely cause | Fix |
|---|---|---|
| No matching WhatsApp lead | The phone has no country code, e.g. 05321234567. | Send +90 532 123 45 67 or 905321234567. |
| Stage not mapped | The stage name differs from the mapping, even by case or accent. | Map it exactly, or send a fixed stage code. |
| Website event accepted but not in Events | The User-Agent looks like a bot. | Set a named User-Agent, e.g. AcmeCRM-AdsPing/1.0. |
| 403 on the Event API | No Origin header. | Add Origin with one of the pixel's allowed domains. |
| Sales counted twice | No eventId, or a new one on every retry. | Derive eventId from the deal, e.g. deal-4821-won. |
| Delivered, but no ad credit | No click ID or contact on the event. | Save click IDs with the lead and send email or phone. |
Rules for developers
- Send right away, in the background. Send from a queue or background job when the stage changes, so moving a deal never waits on AdsPing.
- Retry only on network errors, timeouts, 429 and 5xx, up to 3 times with the same body (1 min, 5 min, 30 min). Duplicates are safe on both paths.
- Keep stage names stable. Tell the account owner before renaming a stage, or send a fixed code instead of the display name.
- Keep secrets on the server. The webhook key and the pixel requests belong in your CRM's backend, not in browser code.