Overview
Integrating Mida with CallRail lets you close the loop on offline (phone-call) conversions. Mida already stores each visitor's ID in a first-party cookie named optimize_uuid. You tell CallRail to capture that cookie, then point a CallRail webhook at Mida's dedicated CallRail endpoint. When a call comes in, Mida reads the visitor's ID from the call payload, records a Phone Call event, and attributes it to the experiment the caller was in.
No code and no Zapier. Mida's CallRail endpoint accepts CallRail's native webhook payload as-is — there is no field mapping or custom body to build. Setup is two steps: capture one cookie, paste one URL. And because Mida matches event-based goals to experiments at report time, you can start capturing calls right away and create (or rename) the matching goal later — past calls from visitors who were in the test are credited retroactively.
💡 How the data flows
The Mida tag sets the
optimize_uuidcookie on your visitor.CallRail's Custom Cookie Capture stores that cookie with the visitor.
The visitor calls your CallRail number.
CallRail posts the call (including
custom.optimize_uuid) to Mida's CallRail endpoint.Mida records a Phone Call event on that visitor.
Your matching event goal credits the call to the caller's experiment.
Prerequisites
The Mida tracking code installed on your site (it sets the
optimize_uuidcookie — nothing to add).CallRail visitor tracking through a Website (Session) tracker number pool. This is required: CallRail does not attach captured cookies to calls placed to static source tracker numbers.
Permission in CallRail to configure Custom Cookie Capture and Webhooks.
Your Mida widget key (used as
project_keyin the webhook URL).
Step 1 — Capture the optimize_uuid cookie in CallRail
In CallRail, open Integrations and select Custom Cookie Capture.
Choose the company where you want to track visitors.
Add
optimize_uuidto the list of cookie names to capture, then Save.
From now on, when a tracked visitor calls one of your CallRail numbers, CallRail includes the cookie in the call webhook under a custom object — this is how Mida identifies the visitor:
{
"custom": { "optimize_uuid": "a1b2c3d4e5" }
}
Step 2 — Point a CallRail webhook at Mida
In CallRail, go to Integrations → Webhooks.
Add a webhook on the Post-Call (Call Completed) trigger.
Set the webhook URL to your account's regional Mida endpoint, replacing
YOUR_KEYwith your Mida widget key:
US region: https://api-us.mida.so/abtest/callrail/webhook?project_key=YOUR_KEY
EU region: https://api-eu.mida.so/abtest/callrail/webhook?project_key=YOUR_KEY
Use the host that matches your Mida region. Mida is region-hosted, and a widget key only resolves on its own region's host, so an EU account must use api-eu and a US account must use api-us. If you are unsure of your region, check the API host in your Mida install snippet, or copy the exact URL shown in your Mida dashboard under Integrations → CallRail.
That is the entire configuration — CallRail only lets you set the destination URL, and Mida's endpoint is built for exactly that. CallRail posts its full call object, for example:
{
"resource_id": "CAL8154748ez...",
"answered": true,
"duration": 43,
"source": "Google Organic",
"custom": { "optimize_uuid": "a1b2c3d4e5" }
}
Mida reads custom.optimize_uuid to find the visitor, records a Phone Call event, and stores useful call metadata (duration, answered, direction, source, and phone numbers) on the event. It also de-duplicates on the CallRail call id, so enabling both Post-Call and Call-Modified triggers will not double count. To record under a different event name, append &event_name=Your%20Event to the URL.
Optional — test it with cURL:
# use your account's regional host (api-us or api-eu)
curl -X POST "https://api-us.mida.so/abtest/callrail/webhook?project_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"resource_id":"CAL123","answered":true,"duration":43,"custom":{"optimize_uuid":"a1b2c3d4e5"}}'
A successful call returns 200 "Event recorded successfully".
Step 3 — Create the Phone Call goal in Mida
In Mida, create a custom event goal whose event name matches the endpoint's event name (Phone Call by default), then attach it to the experiment(s) you want to measure as the primary metric or a secondary metric. Because event goals are matched at report time, every past call from a visitor who was in the test is credited automatically the next time you open the results — so you can start capturing calls first and decide how to attribute them later.
You can also start from your Mida dashboard under Integrations → CallRail → Enable, which links to this guide.
Troubleshooting & notes
Website (Session) pool is required. If a call was placed to a static source tracker number, CallRail sends no captured cookie and the endpoint returns an actionable 400 explaining the two prerequisites (cookie name
optimize_uuidlisted in Custom Cookie Capture, and a Website/Session tracker pool).Retroactive, with one boundary. A call counts only for a caller who was assigned to the test when they visited and whose call falls within the test's active window. Defining the goal later is fine; being in the test is required.
Cookie must exist at call time. Custom Cookie Capture stores the cookie value present when CallRail tracks the visitor, so the Mida tag must have loaded during their visit.
No API key needed. The
project_keyin the URL authorizes the request.Alternative (immediate) path. If you prefer to write the conversion the instant a call lands and already have a goal set up, you can instead POST to your regional host (https://api-us.mida.so or https://api-eu.mida.so) at /abtest/webhook with a goal
keyplusmida_uuid. It records immediately but requires the goal to exist first and will not back-fill past calls.
Conclusion
Capture Mida's optimize_uuid cookie in CallRail and paste one webhook URL — that is all it takes to bring offline phone conversions into your experiments, with no code, no Zapier, and no field mapping to maintain. Attach the Phone Call goal as a primary or secondary metric and Mida retroactively credits every call from visitors who were in your tests.


