Skip to main content

๐Ÿท๏ธ Custom Tags with RTBs

custom tags, real-time bidding, real time bidding, ping, passthrough, passthrough tags

Written by Moja Bot
Updated over 3 months ago

Location: Targets / RTB โ†’ RTBs
โ€‹Last Updated: October 2025


๐Ÿ“ Overview

Custom Tags allow you to insert dynamic variables into RTB requests โ€” including URLs, headers, query parameters, and request bodies โ€” using bracketed placeholders such as:

  • [CALLER_ID]

  • [ZIP_CODE]

  • [STATE]

  • User-defined tag IDs

These placeholders are resolved at request time using the current call and session context. The system preserves correct data types, fills in missing location data when possible, and logs all resolved values for visibility and troubleshooting.


โš™๏ธ How Custom Tags Work

When an RTB request is executed, Moja replaces tag placeholders with real values derived from the active call or session.

  • Tags resolve dynamically per request

  • Numeric values retain numeric types

  • Missing ZIP or State values are filled using NPANXX lookup

  • All resolved parameters are logged per request

You can view resolved values under:
โ€‹Reporting โ†’ RTB Requests โ†’ (+) next to each RTB entry.


๐Ÿ”ง Inserting Tags in the RTB Builder

The RTB builder includes a Variables modal to help you insert tags consistently.

Variables Modal

  • Searchable picker for available tags

  • Insert tags into:

    • Query parameters

    • Headers

    • Request body (structured or raw)

๐ŸŸฆ Tip: Using the Variables picker avoids formatting errors and ensures valid tag syntax.


๐Ÿ“ฆ Body & Raw Body Support

Custom Tags work in both:

  • Structured JSON bodies

  • Raw JSON payloads

Resolved request bodies โ€” including raw payloads โ€” are fully captured and visible in the Reporting panel.


๐Ÿ”ข Numeric Tag Handling

Tags ending with _NUMERIC are automatically emitted as numbers, not strings.

Example:

"bid": 100

instead of:

"bid": "100"

This ensures compatibility with buyer and partner APIs that enforce numeric typing and prevents common downstream parsing errors.

๐ŸŸฉ Runtime Enforcement: Numeric typing is applied at request build time, ensuring consistent behavior across all RTB executions.


๐ŸŒŽ Dynamic Resolution Pipeline

Tag resolution follows a consistent pipeline:

  • Values resolve from the current call or session context

  • ZIP and State use NPANXX fallback when missing

  • Resolution occurs before filters execute, ensuring compatibility with Advanced Filters


๐Ÿงฎ Advanced Filter Behavior

Custom Tags and Advanced Filters work together within the same RTB configuration.

Pre-Resolution for Filtering

  • ZIP and State tags are resolved before filters run

  • Allows filters to reference tags like [STATE] or [ZIP_CODE]

Sequential Filter Evaluation

  • Filters now evaluate left-to-right within each group (AND / OR)

  • Produces predictable results when mixing tag-based conditions

๐ŸŸจ Result: Routing logic behaves consistently even under complex, conditional targeting rules.


๐Ÿ“Š Request Logging

All RTB request data is logged in detail, including:

  • Query parameters

  • Headers

  • Body and raw body payloads

  • Fully resolved tag values

Logs are accessible under Reporting โ†’ RTB Requests, enabling easy debugging and validation.


๐ŸŽฏ Why This Matters

Custom Tags make RTB integrations more flexible, reliable, and observable without requiring schema or code changes.

They help ensure:

  • Correct numeric typing

  • Consistent location data resolution

  • Predictable filter behavior

  • Clear visibility into outbound RTB requests

This is especially valuable for complex routing logic, buyer-specific payloads, and troubleshooting delivery issues.


๐Ÿ’ก Example Use Cases

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

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

  • Reference [STATE] or [ZIP_CODE] inside filters to refine targeting without modifying RTB schemas


๐Ÿš€ Getting Started

  1. Go to Targets / RTB โ†’ RTBs

  2. Open an existing RTB or click Create New

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

  4. Save the RTB

  5. Run a test call

  6. View resolved values under Reporting โ†’ RTB Requests โ†’ (+)


๐Ÿ“Œ Inbound RTB Behavior

Custom Tags cannot be created directly inside Campaigns.
However, if a Campaign references an RTB that uses Custom Tags, those tags automatically pass through and resolve during RTB execution.

Did this answer your question?