Common Workflows
Format Showcase Pages
Build a browsable catalog of available formats:Campaign Review Grid
Review all creatives before launch:Web Component Integration
For production applications with lazy loading:- Shadow DOM for CSS isolation
- Lazy loading (only loads when visible)
- Framework agnostic
Choosing Output Format
Useoutput_format: "url" (default) when:
- Security is paramount (third-party creatives)
- Building interactive preview tools
- Need iframe isolation
output_format: "html" when:
- Building format catalogs (10+ formats)
- Creating campaign review grids (20+ creatives)
- Server-side rendering
- Working with trusted creative agents only
Caching Strategy
Cache individual preview results by format_id + manifest hash:- Cache by format_id + manifest hash (not entire batch)
- Request [A,B,C] → cache each separately
- Later request [B,C,D] → only fetch D
- Always check
expires_atbefore using cached previews
Preview URL Storage
Preview URLs are review resources, not just transport conveniences. A buyer, browser, or MCPUI host may fetch apreview_url after the original preview_creative call returns, after a pod restart, or from a different pod than the one that created the render.
For production agents, persist enough preview state to resolve every preview_url through its advertised lifetime:
- If
expires_atis present, keep the render available until that timestamp. - If
expires_atis omitted, treat the URL as non-expiring at the protocol layer and keep it available until explicit out-of-band revocation or purge. - Use shared storage for multi-process or multi-pod deployments: database metadata plus object storage, a shared cache tier, or an authenticated preview route that can recover the render from durable session state.
- Limit process-local
Mapor LRU storage to single-process demos, local development, or URLs whose advertised lifetime is shorter than the process lifetime you can actually guarantee.
Error Handling
Migration from Single to Batch
Before (Sequential):Use Case Patterns
Device Variants
Geographic Variants
Privacy Compliance Testing
AI Content Variants
Implementation Notes
For Creative Agents
Required:- Return complete HTML pages from
preview_url - Handle all media types (images, video, audio, interactive)
- Echo input parameters in response
- Validate manifest before rendering
- Apply macro values (or use defaults)
- Back preview URLs with storage that survives load balancing and restarts for the URL’s advertised lifetime
- Implement security sandboxing
- Set reasonable expiration (24-48 hours) for previews that should not be retained indefinitely
- Provide
hintsobject (media type, dimensions, duration) - Provide
embeddingmetadata (sandbox policy, CSP) - Support responsive design
- Include accessibility features
For Buyers
- Just iframe the
preview_url- no special rendering needed - Use
inputsarray for specific scenarios - Check
inputfield to confirm macros applied - Share preview URLs with clients for approval
- Use
interactive_urlfor advanced testing
For Publishers
- Return consistent HTML from preview URLs
- Implement responsive preview pages
- Document supported macros via
supported_macrosin formats - Clarify preview vs production differences
- Consider providing
interactive_urlfor testing
Related Documentation
- preview_creative - Basic usage and parameters
- Creative Manifests - Manifest structure
- Universal Macros - Available macro values