Track calls with customer-owned Twilio numbers
Connect completed calls, assign visitor numbers and manage consented call recordings.
Last updated November 29, 2026
Before you connect
Use an existing Voice-capable number in your own Twilio account. AEO Goal verifies ownership through Twilio; it does not purchase numbers, place calls, change your inbound Voice URL, modify Studio flows or enable recording at Twilio.
Twilio Voice trial restrictions still apply. WhatsApp sandbox delivery and test credentials cannot prove a real Voice callback or recording workflow. Real calls, recordings and Twilio storage can incur separate provider charges.
The recommended setup is a dedicated pool of customer-owned numbers with reviewed routing, caller-consent controls and authenticated media. Keep your original business number as the fallback when the pool is exhausted or consent is absent.
Connect completed-call outcomes
- Select the correct brand and open Site Tracking → Connections → Twilio call outcomes.
- Enter the Account SID, primary Auth Token and an existing number in E.164 format.
- Choose Connect existing Voice number. The token is encrypted and is never displayed again.
- Copy the Status callback URL. In Twilio Console, open Phone Numbers → Manage → Active numbers, select the number, and review Call status changes.
- Configure HTTP POST to that URL only if the status callback is available. Preserve A call comes in, TwiML applications, Studio and existing callbacks. If a callback is already in use, coordinate with your workflow owner; do not silently replace it or forward an invalid signature.
- Complete a controlled call and confirm the last received time changes.
Completed callbacks are signature checked and read back from Twilio. They create one deduplicated call outcome, without inventing revenue. Attribution uses the visitor number’s lease at the provider’s call creation time, or a unique prior verified phone match within this brand. Callbacks older than seven days are refused.
Assign visitor numbers
Under Visitor call numbers, add existing account-owned Voice numbers. Every number is independently checked for ownership and Voice capability. Pool numbers must have their own reviewed inbound routing and completed-call status callback; adding a number does not configure these at Twilio. A number can be reserved by only one brand in the same Twilio account. Pool removal requires a separate routing and lease-history review; this control only adds numbers.
Assignments last 30 minutes, followed by a five-minute reuse cooldown. Repeating a
request for the same visitor returns its current assignment without extending it.
An exhausted pool returns 409; keep the original number and avoid automatic
retry loops. These assignments identify a browser session; they do not establish
the identity of the person calling. A number copied or saved and called after
expiry may be unmatched or attributed to a later lease.
Your developer marks only telephone links whose number should be replaced:
<a data-aeo-call-number href="tel:+15551234567">Call our team</a>
<script defer src="https://app.aeogoal.com/t/calls.js"></script>
After the existing tracker is ready and analytics consent is granted, call:
await window.aeoCallNumbers.assign();
The optional bundle reads the public site key from the existing tracking tag and
uses aeo('visitorId'). It makes no request when there is no consenting visitor.
It replaces only marked links, restores them when the lease expires, and restores
on navigation or detected identity changes. It does not assign without an explicit
call to assign() and does not auto-renew leases. On consent withdrawal or logout,
restore synchronously before changing tracking state:
window.aeoCallNumbers.restore();
aeo('consent', false);
The bundle must be published with the complete frontend artifact. A missing bundle means replacement is not active; the original business number remains usable. For a custom integration, the underlying API is:
POST https://api.aeogoal.com/api/collect/calls/assign
Content-Type: text/plain
Origin: https://your-approved-site.example
{"k":"aeo_pk_your_public_key","vid":"consented_browser_id","consent":true}
The successful response contains only number and expires_at. Site origin,
tracking access and daily event limits apply. Set tel: and visible text only
after validating the response, and restore the original link on expiry, consent
withdrawal, logout and failure. No private Twilio credential belongs in this code.
Accept recordings with explicit caller consent
Recording is off by default. In Consented call recordings:
- Verify your existing TwiML or Studio workflow obtains required caller consent before any recording starts. An analytics-consent checkbox is not call-recording consent. Consult your own approved policy for the callers and jurisdictions involved.
- Select Accept recordings from my existing consent workflow and confirm the caller-consent workflow and separate Twilio recording/storage charges.
- Choose retention from 1-30 days and a retained-audio limit in seconds, then Save recording controls. Retention edits apply to new recordings.
- Copy the Recording status callback URL into your existing recording workflow
using POST and the
completedrecording event. Configure it on the recording operation, separately from the number’s completed-call callback. Never replace a workflow’s required callback without its owner’s review. - Enforce authentication on Twilio media. Keep recordings on the inbound call leg associated with the owned number; unrelated outbound-leg recordings are rejected.
- Set a recording duration limit in your own TwiML workflow. AEO Goal accepts at most one hour per recording and queues over-limit recordings for deletion.
This setting attests that your existing workflow enforces caller consent; AEO Goal cannot independently prove a caller’s consent or repair an unconsented recording. It never starts recordings. Historical recordings predating configuration are not imported or deleted by an unsolicited callback.
Accepted recordings remain in Twilio’s authenticated media store. AEO Goal stores private metadata, not a second copy of the audio or a public provider URL. Playback requires an authenticated user authorized for the current brand. It downloads at most 20 MiB through the backend without following redirects. Playback creates a short-lived browser blob that is released when the player closes.
The retained-audio limit includes pending provider deletions. When accepting a new callback would exceed that limit, its recording is hidden and queued for provider deletion. This is a retention limit, not a cap on Twilio’s bill: your workflow can still create provider charges before delivery. Use Twilio’s own usage controls and stop recording upstream to stop those charges. The session-replay budget is not charged or reused for calls.
Expired media is inaccessible immediately. Scheduled maintenance processes up to 100 deletions per run, and retries provider failures. A deletion backlog can delay physical provider deletion; monitor the task and pending-deletion status. You can choose Delete recording from Twilio for immediate deletion. If that fails, the recording stays hidden and deletion remains retryable. Delete retained recordings before disconnecting or switching accounts/numbers, so deletion can still authenticate. A verified token rotation for the same account and number preserves the recording configuration and lets retention recover when an old token stops working.
Disabling intake does not disable recording in Twilio or erase already accepted recordings. New callbacks from the previously configured workflow are hidden and queued for deletion. Stop recording in your own workflow as well. Privacy erasure hides matching recordings and queues provider deletion while preserving occupied number lease windows; deleting a person must not prematurely reassign their number.
Verify your integration
Test each pool number with two consenting browsers, pool exhaustion, consent withdrawal, lease expiry and a real completed call. Confirm exactly one outcome and correct visitor attribution. Then use your caller-consent workflow to record a controlled call, play it as the correct brand, deny access from a different brand, delete it, and verify the media is no longer available at Twilio.
Local automated tests use Twilio’s real HTTP API contract with external requests substituted at the network boundary. They do not prove trial-account delivery, caller consent, production callbacks, scheduled deletion or deployed browser behavior.
Provider references: IncomingPhoneNumber, Recordings API, and media authentication.
Review a new number without automatic purchase
Number procurement review is disabled unless the operator enables
TWILIO_NUMBER_PROVISIONING_ENABLED. This gate enables discovery, quotes and
owner approval only. There is deliberately no automatic purchase endpoint.
The brand owner can discover up to ten Voice-capable numbers per request, with 20 discovery requests per day, and create up to five quotes per rolling day. Failed provider verification still consumes a quote operation; an identical request key never silently starts another attempt. Twilio requires an upgraded account for API number provisioning; Voice trial capability alone is not acquisition proof. Each quote binds a stable request key, exact number, account, country/type, HTTPS Voice URL and completed-call callback. Quotes expire after ten minutes. Confirm the exact number, monthly price and currency, and explicitly review routing and separate Twilio charges. Price is read again before approval. Changing the plan requires a new request key; retrying the same plan is deduplicated.
The owner then reviews the final price and regulatory requirements in Twilio Console. Approval here is a reviewed plan, not proof of purchase or reserved inventory. Twilio’s account-specific country/type pricing endpoint does not bind a maximum price to its number-purchase request; the purchase resource documents neither an expected-price condition nor a client idempotency key. AEO Goal therefore does not claim an atomic price guarantee or automatically retry a purchase.
After a Console purchase, choose Verify ownership after Console purchase. Read-back checks ownership, Voice capability, the exact Voice URL and POST method, and the exact status callback and POST method. A Studio application or trunk association is reported as a routing conflict rather than being replaced. A provider timeout leaves reconciliation pending. A missing number remains awaiting Console purchase; neither result triggers a provider mutation. Once verified, add the existing number to your visitor pool. No automatic purchase, release or call placement occurs in this workflow.
Official APIs used for these reads are AvailablePhoneNumbers, account-specific monthly pricing, and IncomingPhoneNumbers read-back.
Deletion after brand or account erasure
Before deleting a brand, account or integration credential, the application must atomically preserve outstanding recording deletions in the existing exact-object erasure backlog. That backlog has no foreign key to the deleted account. Its Twilio deletion envelope is encrypted at rest and retains only the identifiers and credential needed to delete that exact provider recording. It is never returned through the public API. Successful erasure clears the envelope. Deleting a brand queues provider recording erasure as well: restoring the brand does not restore audio already erased at Twilio.
The existing worker handles provider failures independently, with persistent attempt counts, bounded batches and backoff up to one day. A missing or revoked credential does not stop other accounts’ deletions. A failure that needs credential repair remains unresolved and follows the existing erasure escalation policy. Visitor erasure queues only matching records in the same transaction; it does not perform a global synchronous provider purge from the HTTP request.