Geo Data Handling
Quick reference — where geo comes from
| Source | When it applies |
|---|---|
| RTB Inbound Request | Reservation / pre-call ping |
| Data Writing | Before or during the call (stored, then applied) |
| Carrier geo | When a call starts |
| Caller Number geo | When a call starts |
| Webhook responses | Start, data-appending, enhance, post-zip pings |
| ZIP prompt | When routing |
1. RTB Inbound Request
When a publisher pings your RTB endpoint, they can supply location in the request body or query string.
Common parameters:
| Parameter | Effect |
|---|---|
caller_zip |
Sets the call's zip and adds a geo tag (us-xxxxx), plus city/state when Retreaver has that zip in its zip database |
geo |
Adds one or more geo tags (country us, state us-co, zip us-90210, area code 310, etc.) |
These keys are not prefixed with your postback key name — they apply directly to the call.
Example — explicit zip on RTB Inbound Request:
curl -X POST "https://rtb.retreaver.com/rtbs.json?key=YOUR_POSTBACK_KEY&caller_number=17195551234&caller_zip=90210"The reservation keeps caller_zip=90210 even if the phone number would normally parse to a different zip, because RTB values are applied before caller-number inference.
Example — geo tags without zip:
curl -X POST "https://rtb.retreaver.com/rtbs.json?key=YOUR_POSTBACK_KEY&caller_number=17195551234&geo=us-ca"Adds a California state geo tag. Combine with caller_zip when you need both.
Important
RTB geo is applied when the reservation is processed. It is not replaced by campaign toggles turning on carrier or caller-number inference later — those only fill blank fields at inbound connect time.
2. Data Writing request
The Data Writing API lets you attach tags to a caller before they connect (or during the call), keyed by caller number or call UUID.
Whitelisted keys (same as RTB): geo, caller_zip. Other keys are stored with your affiliate/postback prefix.
How it flows:
- Send tags — POST to the Data Writing endpoint with the caller's phone number (or call UUID) and the geo you want (
caller_zip,geo, etc.). - Caller connects — when that number calls in, Retreaver matches your data to the call.
- Applied before routing — your tags are on the call before carrier or Caller Number geo can fill in anything still blank.
Example — set zip before the caller dials:
curl -X POST "https://retreaverdata.com/data_writing?key=YOUR_KEY&caller_number=17195551234&caller_zip=33172"When the call comes in, 33172 is on the call before carrier or phone inference runs.
Important
Data Writing treats caller_zip and geo the same way as RTB: caller_zip sets the zip on the call and adds geo tags; geo adds geo tag values. If you send the same key more than once, the newest value wins.
3. Caller Number geo information
Open a campaign → Toggles tab → Geo Data Handling card. Use Caller Number geo information defaults to on.
Use geo location tags extracted from the caller number (country, state, city, zip code) unless already supplied via an RTB Inbound Request, a Data Writing request, or extracted from the carrier (see Use carrier geo information in the next section).
When on: when the call comes in, Retreaver parses the caller's phone number and may set city, state, country, zip, and geo tags such as us, 719, us-co.
When off: no phone-derived geo fields or tags are added. Carrier geo can still apply if Use carrier geo information is on.
Example — disable Caller Number geo only:
- Turn off Use Caller Number geo information.
- Leave Use carrier geo information on.
RTB reservations without caller_zip get no phone-derived zip or geo tags, but when the call comes in it can still receive city/state/country from the carrier.
Example — disable both toggles:
Turn off both Use Caller Number geo information and Use carrier geo information. Only geo you send explicitly (RTB, Data Writing, IVR, webhook responses, ZIP prompt) will appear on the call.
On an RTB Inbound Request (before the caller dials), Caller Number geo fills in after any values you sent on the request. Carrier geo does not apply until the caller connects — see Precedence in the next section.
Example — parsed zip from the phone number:
| Caller number | Toggle on | Typical zip |
|---|---|---|
+1 719 522 8888 |
On | 80918 (Colorado Springs area) |
+1 719 522 8888 |
Off | (blank unless supplied elsewhere) |
The [caller_zip] token in webhooks uses the zip on the call, or the parsed approximate zip when none was supplied.
4. Carrier supplied geo information
Use carrier geo information is on the same Geo Data Handling card and also defaults to on.
Use geo location tags from the carrier (country, state, city, zip code) unless already supplied either via an RTB Inbound Request or via a Data Writing request.
When on: when the call comes in, inbound and click-to-call legs read carrier webhook fields (city, state, country, zip on the caller's leg) and populate any blank location fields.
When off: carrier fields are ignored. Caller Number geo can still apply if Use Caller Number geo information is on.
Example — disable carrier geo only:
- Open the campaign → Toggles → Geo Data Handling.
- Turn off Use carrier geo information.
- Leave Use Caller Number geo information on.
An inbound caller dials your tracking number from +1 719 522 8888. The carrier webhook reports Denver, CO, and zip 80202. With carrier geo off, those values are ignored.
Carrier geo does not run on an RTB Inbound Request — there is no carrier webhook until the caller dials.
For some accounts, an empty zip from the carrier is treated as missing so Caller Number geo can still fill in a zip when that toggle is on.
Precedence
Inbound calls (when the caller connects):
- RTB Inbound Request or Data Writing — values already on the call from the reservation or an earlier Data Writing request.
- Carrier geo — if Use carrier geo information is on and the field is still blank.
- Caller Number geo — if Use Caller Number geo information is on and the field is still blank.
RTB reservations (when the ping is processed — before the caller dials):
- RTB Inbound Request — values you send on the request (
caller_zip,geo, etc.). - Caller Number geo — if Use Caller Number geo information is on and the field is still blank.
At claim time, inbound precedence applies for any fields still blank.
Upstream / simuldial calls: when a call is linked to an upstream call, geo fields from that upstream call are copied as-is. The toggles above do not apply to inherited upstream geo.
5. Geo information appended by webhooks
Start, data-appending, and other types of webhooks can return tags in the JSON response. Retreaver applies them to the call the same way as RTB and Data Writing tags.
Retreaver IQ: Retreaver IQ by Audience Acuity is a built-in enrichment integration that can populate caller_zip and related geo on inbound calls — via a Data Append webhook for ping-first workflows. IQ-supplied geo follows the same rules as any other webhook response below.
Response formats:
{
"retreaver": {
"tags": [
{ "key": "geo", "value": "us-90210" },
{ "key": "caller_zip", "value": "90210" }
]
}
}Or top-level keys (except Data Writing URLs):
{
"geo": "us-90210",
"caller_zip": "90210"
}Overwriting existing geo:
- When a webhook returns
caller_zipor a zip-stylegeovalue (us-xxxxx), Retreaver clears clearable geo tags (country, state, zip — not area code) and updatescaller_city,caller_state, andcaller_zipfrom the zip database. - During waiting-room re-pings (ping round > 1), webhook tags with the same key can replace tags from an earlier ping response. Start-of-call ping round 1 uses the default append behavior.
This is independent of the carrier / Caller Number geo toggles — those only control inference at call creation. Webhook-supplied geo from pings always takes effect when returned.
Example — webhook that only enriches calls missing zip
You want a start webhook to run enrichment only when the call has no zip yet — e.g. skip when RTB already sent caller_zip.
Configure the webhook timer's tag rules (or the buyer's forward tags, depending on your setup) with:
caller_zip!~.+
How to read this:
caller_zip— the string tag key!~— "does not match" (regular expression).+— one or more characters (i.e. any non-empty value)
So caller_zip!~.+ matches when there is no caller_zip tag value on the call — exactly "doesn't already have a caller zip present."
Pair that rule with a webhook response that returns:
{
"retreaver": {
"tags": [
{ "key": "caller_zip", "value": "90210" }
]
}
}Calls that already have zip from RTB or Data Writing won't match caller_zip!~.+ and won't be sent to that enrichment path; calls without zip will match and receive the webhook's geo.
Important
RTB caller_zip sets the call column and geo:us-xxxxx tags. Tag-matching rules like caller_zip!~.+ inspect tag values on the call. If you rely on this pattern, confirm the call has (or lacks) the caller_zip tag you expect — not only the column — when debugging routing.
6. ZIP prompt
Campaign Prompts can ask callers to enter a 5-digit ZIP before routing. There are two prompt types:
ZIP code entry — unless already present
Prompt action: ZIP code entry — unless already present
When it plays: the caller is US-based and the call has no geo tag matching us-xxxxx (no zip geo tag yet).
When it skips: RTB, Data Writing, carrier, caller-number, or an earlier webhook already left a zip geo tag on the call.
Use this when you only need to collect zip from callers who didn't provide it upstream.
ZIP code entry — always
Prompt action: ZIP code entry — always
When it plays: every caller who has not yet completed this campaign's "always" ZIP IVR in the current flow — even if zip geo is already on the call from RTB, Data Writing, carrier, or phone parsing.
When enabled: requires the ZIP IVR always feature for your campaign (contact Retreaver support or your account manager to enable).
Overrides existing geo: a valid 5-digit entry calls the same set_zip path as caller_zip / geo:us-xxxxx — clearable geo tags are replaced and city/state/zip columns update. If the caller enters an invalid zip, the always prompt may clear stale zip/geo from a prior override before re-prompting.
Precedence vs "unless already present": if both prompts exist and always is enabled for the campaign, always wins.
After ZIP entry: if you configure post-zip webhooks, they fire after a successful entry (with a brief ring while pings run) before routing continues.
Practical workflows
Publisher sends zip on RTB — don't guess over it
- Publisher includes
caller_zip=90210on every RTB Inbound Request. - Leave both geo toggles on (default).
- Retreaver keeps
90210from the RTB Inbound Request; caller-number parsing does not replace it.
Stop phone zip guessing, keep carrier city/state
- Toggles → turn off Use Caller Number geo information.
- Leave Use carrier geo information on.
- Inbound calls still get carrier city/state/country; zip and geo tags from phone parsing are not added.
Collect zip on every call for compliance
- Ask Retreaver to enable ZIP IVR always for the campaign.
- Add prompt ZIP code entry — always to the campaign.
- Callers hear the ZIP prompt before routing even when RTB sent a zip — their entry replaces prior zip/geo.
Enrich only calls missing zip via start webhook
- Add a start webhook timer with tag rule
caller_zip!~.+. - Return
caller_ziporgeo:us-xxxxxin the JSON response when your enrichment service finds a zip. - Leave Use Caller Number geo information on as a fallback for calls the webhook doesn't match.
Key takeaways
- You control geo via RTB
caller_zip/geoand Data Writing — those win over automatic inference. - Campaign toggles independently control carrier geo and caller-number geo (both default on).
- Webhooks can add or overwrite geo during ping rounds;
caller_zip/ zip-stylegeoresponses clear and replace clearable geo tags. caller_zip!~.+is the tag rule for "no zip present yet" when configuring enrichment or routing.- ZIP unless present skips when zip geo already exists; ZIP always plays regardless and overrides — when the feature is enabled for your campaign.
- Upstream calls copy geo from the parent call; toggles don't apply there.
Help us improve this article or request new support guides.