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…UseYour CRM sends
A message from a Click-to-WhatsApp ad, on a WhatsApp number connected to AdsPingA. CRM webhookPhone number + stage name
A form on your website or landing page, or any lead that visited your siteB. Event APIEvent name + customer details + the ad click saved with the lead
Leads from Meta Lead Ads (instant forms) and from built-in CRMs such as Pipedrive, HubSpot, Kommo, GoHighLevel, Bitrix24, Zoho or Salesforce have their own guides in this section. Use those instead when they fit.

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.

1

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.

2

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.

3

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.

4

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

http
POST https://api.adsping.io/api/v1/webhooks/feedback/YOUR_KEY
Content-Type: application/json

No 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.

FieldTypeRequiredDescription
stagestringyesThe deal's new stage, spelled exactly as mapped in AdsPing.
phonestringone of these threeThe customer's WhatsApp number with country code, e.g. +90 532 123 45 67. The best match key.
externalIdstringone of these threeYour CRM's ID for the lead or deal.
emailstringone of these threeThe customer's email. Also improves match quality.
valuenumberon salesDeal amount as a JSON number, e.g. 1200, not "1200".
currencystringwith valueISO 4217 code: USD, EUR, TRY…
firstName, lastName, city, state, zip, countrystringnoHashed before they reach Meta. Each one improves match quality.
bash
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.

ResponseMeaningWhat to do
200 {"received":true}Accepted and queued.Nothing. Check Recent calls in the panel.
503Temporarily unavailable. Comes with Retry-After: 60.Retry the same body later.
413Body 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 panelMeaning
SentMatched and queued for Meta. It goes out after the 60-second pause.
No matching WhatsApp leadNo conversation with this number on a connected WhatsApp number, or the phone is missing its country code.
Stage not mappedIgnored on purpose. Click Map stage next to it to start sending it.
Already sentThis stage is already waiting for this lead.
No phone, email or idThe body has none of the three match keys.
Body not understoodA 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.

1

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:

javascript
// 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.

2

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.

3

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

http
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 as curl/8.x, python-requests or Node's default undici, 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.
bash
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" }
  }'
FieldRequiredDescription
eventNameyesPurchase, Lead, CompleteRegistration, Schedule, Contact… Case-sensitive.
eventIdyesStable per conversion, built from the CRM record, e.g. acme-deal-4821-won. Two events with the same id count once.
eventTimerecommendedUnix seconds when it happened. Up to 7 days in the past. Defaults to now.
actionSourcerecommendedsystem_generated for CRM outcomes.
orderIdon salesYour deal or order number. Google Ads also deduplicates on it.
customData.valueon salesAmount as a number.
customData.currencywith valueISO 4217 code.
email, phonestronglyPlain text or SHA-256. Hashed before they leave AdsPing. Phone with country code.
firstName, lastName, city, zipCode, country, externalIdnoEach one improves match quality.
fbc, fbp, gclid, gbraid, wbraid, ttclid, msclkid, sccidwhen you have themThe click IDs saved with the lead in step 1.

Responses

ResponseMeaning
201Accepted and queued. The body echoes your eventId.
400Malformed body, e.g. no eventName.
403Origin missing or not one of the pixel's allowed domains.
404Wrong pixel ID.
429Over a rate limit. Slow down and retry.
A 201 means accepted, not delivered. An event can still be filtered afterwards, for example as bot traffic or while tracking is paused. Confirm delivery in Events.

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 seeLikely causeFix
No matching WhatsApp leadThe phone has no country code, e.g. 05321234567.Send +90 532 123 45 67 or 905321234567.
Stage not mappedThe 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 EventsThe User-Agent looks like a bot.Set a named User-Agent, e.g. AcmeCRM-AdsPing/1.0.
403 on the Event APINo Origin header.Add Origin with one of the pixel's allowed domains.
Sales counted twiceNo eventId, or a new one on every retry.Derive eventId from the deal, e.g. deal-4821-won.
Delivered, but no ad creditNo 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.
Phone numbers, emails and names are hashed before they reach any ad platform. AdsPing never sends them in the clear. Need help with an integration? Write to [email protected].

Was this page helpful?