Skip to main content

Custom Tags with RTB

D
Written by Denise Abdullah
Updated over 2 months ago

Custom Tags with RTBs

Location: Targets/RTB → RTBs
Custom Tags let you insert dynamic variables into RTB requests — URL, headers, query params, or body — using bracketed placeholders such as [CALLER_ID], [ZIP_CODE], or user-defined tag IDs.
The system resolves these tags at request time, preserves numeric types, and fills in missing ZIP or State data using NPANXX lookup.
All resolved values can be viewed under Reporting → RTB Requests → (+) beside each RTB entry.What’s New

  • Variables Modal in RTB Builder — Insert tags into Query, Headers, or Body fields using a searchable picker.

  • Body & Raw Body Support — Tags work in both structured and raw JSON payloads; results visible in Reporting.

  • Numeric Tag Handling —

Tags ending with _NUMERIC are automatically emitted as numbers (not strings) when the request is built.
This prevents errors when buyer or partner APIs expect numeric types (e.g., sending "bid": 100 instead of "bid": "100").
By enforcing numeric typing at runtime, the system eliminates a common source of downstream parsing errors and ensures API compliance.

  • Dynamic Resolution Pipeline — Tag placeholders resolve from the current call/session context, with NPANXX fallback for ZIP and State.

  • Pre-Resolution for Filtering — ZIP and State tags are resolved before filters run so Advanced Filters stay compatible.

  • Sequential Filter Evaluation —

Filters now evaluate left-to-right within each group operator (AND/OR).
Previously, mixed operators could yield inconsistent results. Now, each group executes sequentially, producing predictable routing logic — especially when tag-based filters (e.g., [STATE], [PUBLISHER_ID]) are used.

  • Request Logging Upgrades — All query, body, and raw data captured per RTB request and displayed in the Reporting panel.

Why This Matters
Custom Tags make RTB calls more flexible and data-rich without engineering changes.
They ensure correct numeric typing, consistent location data resolution, and predictable filter behavior — improving delivery accuracy and troubleshooting visibility.
The combination of tag-based substitution and improved filter sequencing ensures routing behaves predictably even under complex targeting logic or conditional rules.

Special Note: Custom Tags and Advanced Filters work together within the same RTB configuration. You can use tags like [STATE] or [ZIP_CODE] inside filter conditions to build precise, data-driven routing logic directly from the RTB page.

Example Use Cases

  • Add [CALLER_ID] and [ZIP_CODE] to a POST body; Moja auto-resolves ZIP/State from NPANXX if missing.

  • Include [BUYER_ID] in headers and [PAYOUT_NUMERIC] in the JSON body for buyer-specific attribution.

  • Reference [STATE] or [ZIP_CODE] tags in filters to refine targeting without editing the RTB schema.

Getting Started

  1. In the left navigation, go to Targets/RTB → RTBs.

  2. Select an existing RTB or click Create New.

  3. In Query, Headers, or Body, click Variables to insert a tag.

  4. Save your RTB.

  5. Run a test call and view resolved parameters under Reporting → RTB Requests → (+) beside the RTB.

Inbound RTB Behavior: You cannot create Custom Tags directly in Campaigns, but if a Campaign references an RTB that uses them, those tags automatically pass through and resolve in the RTB request.

Did this answer your question?