Connecting Didar CRM
Didar runs in two directions: AdPix pushes the lead out, and Didar sends the won deal back, so the revenue lands on the campaign that produced the visitor.
Two directions, not one#
The Didar connection lives in Admin → Integrations (/admin?sel=integrations) and, like the rest of
that pane, it is organised around two opposing flows. Keep them apart or the settings read as
contradictory:
| Direction | What moves | What it makes possible |
|---|---|---|
| AdPix → Didar (outbound) | leads and sales, carrying the acquisition channel and campaign | your sales team sees on the contact card where the person came from |
| Didar → AdPix (inbound) | won deals, lost deals, invoices, payments | revenue lands on the campaign that produced the visitor |
The outbound direction is an ordinary destination and is covered in Integrations and CRM modules. This page is about the inbound direction — the thing no browser tag can do, because the deal closes weeks later and outside the browser.
The AdPix tag sees the visitor's journey up to the moment they leave. In B2B or project sales the buying decision happens weeks later, on a phone call. Until Didar sends that moment back, the revenue does not exist in AdPix, and the campaign that earned it looks like it produced no sales in your ROAS report.
What you need from Didar#
Before you start, you need three things from Didar, and all three require an admin account there:
Connecting#
In the "Read deals back from Didar" card, enter the API key and the owner ID, then pick where revenue is counted from. AdPix verifies the key with one cheap call before saving: a connection that cannot talk to Didar is worse than no connection, because the webhook would then be set up against a dead key.
After saving, the webhook address is shown once:
Didar's webhook form accepts no custom header and no signing key, so the token in the address is the only credential on this path: anyone who has it can send events for this website. AdPix stores only a hash of it, and the full address is never shown again. Keep it somewhere safe, never paste it into a public channel, and if it leaks, mint a New address and Revoke the old one.
Creating the webhooks in Didar#
This part is manual and there is no way around it: Didar has no API for creating webhooks. In Didar, go to Settings → Connect to other servers → Webhook and create one webhook per row below. Use the same address for every one — the Didar payload says what it is, so one entry point is enough.
| Entity in Didar | Type | What it is for |
|---|---|---|
| Deal | create and edit | won deals, lost deals, and newly opened deals |
| Person | create and edit | a new lead, and its promotion to a qualified lead |
| Invoice | create and edit | only if you set revenue to be counted from invoices |
| Payment | edit | only if you set revenue to be counted from payments |
Didar's other entities — company, note, product, case — carry no analytical meaning in a visitor's journey. Do not create webhooks for them; they only generate traffic nobody reads.
A typo in the address produces no error — not in Didar, not in AdPix. The only signal that the setup is right is the connection status turning green. If you have created the webhooks, made a test change on a deal, and still see "Waiting for the first event", check the address in Didar again.
Event map#
Every Didar event is recognised by a precise condition, not by a payload arriving. That is because Didar's edit webhook fires when any field changes; without a condition, correcting a phone number would become an analytics event.
| In Didar | AdPix event | Money | Default |
|---|---|---|---|
| a new person was created | generate_lead |
— | on |
| a contact became a qualified lead | qualify_lead |
— | on |
| a new deal was opened | crm_deal_open |
estimated value | on |
| a deal was won | purchase or crm_deal_won |
deal value | on |
| a deal was lost | crm_deal_lost |
— | on |
| a won deal was deleted | refund |
deal value | on |
| an invoice was issued | purchase |
invoice total | invoice mode only |
| a payment was settled | purchase |
payment amount | payment mode only |
| a deal moved stage | crm_stage_change |
— | off |
Stage changes are off by default because an active sales team produces thousands a day. Turn them on if you want sales-funnel analysis, knowing the event volume rises.
Currency#
Every Didar amount is read as toman. Didar's currency identifier is a number with no lookup service anywhere in its API, so AdPix built no setting for it and instead stamps the raw number on each event. If your amounts are in rial, talk to support before connecting.
Revenue source: why one sale is not counted twice#
A won Didar deal and a WooCommerce order can be the same sale, but their identifiers have nothing in common, so AdPix cannot collapse them onto one row. If both were counted, revenue would read double.
So each connection has exactly one revenue source, and AdPix decides it:
| Revenue source | When | What a won deal becomes |
|---|---|---|
| the website | the website recorded purchases in the last 30 days | crm_deal_won with no money — the funnel, lead quality and lost reasons all keep working |
| Didar | the website sends no sales of its own | purchase with the full amount |
The Revenue source card explains that decision, with the 30-day purchase count behind it. The value is stored, not recalculated per event: analytics rows are append-only and are never rewritten, so a value that flapped between two deliveries would bake a history nobody could explain.
The same rule applies inside Didar: "Count revenue from" offers won deals, invoices and payments, and exactly one is active. For instalment sales, payments is the most accurate choice, because revenue is recorded when the money arrives rather than when the deal closes.
Identity: how a deal reaches the visitor#
For each Didar event AdPix uses the strongest key available:
| Priority | Key | Where it comes from |
|---|---|---|
| 1 | mobile number | the contact's mobile field — Didar requires it to be unique and it is nearly always filled |
| 2 | the contact's email field | |
| 3 | Didar contact ID | stored as the CRM client ID, so later events need no personal data at all |
Mobile comes first because in the Iranian market it is nearly always present. A number written with
Persian digits is read correctly and reaches the same identity as its international form — so
۰۹۱۲۳۴۵۶۷۸۹ and +989123456789 are one person.
If your website's customer-data mode is anything other than raw, the connection never sends a raw mobile or email and hashes before sending. In that mode a calling code is required, because a webhook payload carries no IP from which a country could be inferred.
If the visitor filled in a form or signed in on your site, their phone or email finds the identity their browser journey is attached to — and the deal inherits their first and last touch. But if the lead was created by hand in Didar after a phone call, there is no browser journey to attach it to; the revenue is recorded, without an acquisition channel.
Missed events#
Didar does not guarantee webhook delivery. If AdPix is unreachable, that payload is lost and Didar has no way to replay it. So AdPix also re-reads deals periodically and makes up anything the webhook never delivered.
This runs in the background and deliberately unhurried (Didar documents no rate limit at all, so AdPix is conservative). The Check for missed events button starts a pass now.
Because every write uses a fixed, derived identifier, re-reading a deal the webhook already delivered adds no new row.
An event more than seven days old is not recorded. Not because it is hard: it would be stamped with today's date, and on its first pass a CRM with years of history would pour all of it onto today as a spike of revenue that never happened — and analytics rows are append-only, so it could not be removed. The state of those deals is still read and kept; only no event is created.
Connection health#
The health card shows four counters read straight from the database: deliveries, mapped, ignored and rejected, together with the reason the last ignored delivery was ignored.
"Ignored" is not an error. A stage change on default settings, or a webhook created for an entity AdPix does not map, is counted here. If deliveries are high and nearly all of them are ignored, you have created the wrong webhooks in Didar — the reason beside the counter says which.
The window figure is counted "since" the time shown, not "in the last 24 hours": the window resets once it ages past 24 hours and starts again.
Changing and disconnecting#
- New address mints a second address while the previous one keeps working. The right order is: mint the new one, replace it in Didar, then revoke the old one. Nothing is lost that way.
- Revoke invalidates an address. AdPix refuses to revoke the last live address of an enabled connection, because Didar would keep posting to an address that no longer accepts anything and nobody would be told.
- Delete connection revokes every address and switches the connection off. Events already recorded stay in your reports.
Access required#
Viewing this card needs report-read access, and the API key is shown only as its first few characters. Creating the connection, changing its settings, minting or revoking an address, and deleting the connection all require the edit-website-settings capability and are written to the audit log.
Frequently asked questions#
Why is the webhook address shown only once?
Because it IS the credential. Didar's webhook form accepts no custom header and no signing key, so the token in the address is the only thing tying a delivery to your website. AdPix keeps only a hash of it; if you lose it, mint a new address and revoke the old one.
A deal was won but no revenue appears in the reports. Why?
If your website already reports sales (WooCommerce, for example), WooCommerce stays the source of revenue and a won Didar deal is recorded as crm_deal_won with no money figure. That is what stops one sale being counted twice. The Revenue source card in the panel explains the decision.
Will older Didar deals appear in the reports?
No, and that is deliberate. The event window is seven days; anything older is not recorded, because it would be stamped with today's date and create a spike of revenue that never happened — and analytics rows are append-only, so it could not be removed. Their state is still read and kept, so later changes to them are detected.
Are Didar amounts in rial or toman?
AdPix reads every Didar amount as toman. Didar's currency identifier is an opaque number with no lookup service anywhere in its API, so no setting was built for it; instead the raw number is stamped on every event, so the real data is already there if it is ever needed.
Thanks — your feedback helps us improve the docs.