Skip to main content

AI Search with Sponsored Text Weaving - Technical Overview

⚠️ Important: This use case is about weaving sponsored text into LLM responses, not displaying separate visual product cards. For visual product ads, see AI Search Product Ads.

📺 Live Demo: See this implementation in action at https://demo-aura.affinity.net/ai-llm-weaving

Executive Summary

This document outlines how AI publishers can weave sponsored text naturally into LLM-generated responses using the AdCP (Ad Context Protocol) framework. When users search on your AI platform, your LLM (provided by you, the AI publisher) generates answers that include relevant sponsored mentions alongside organic recommendations. Users can click these mentions to see detailed information.

Key Distinction: This is about text integrated within the LLM response, not separate visual product cards. The LLM weaves sponsored brand mentions naturally into its answer text.

Key Benefits:

  • Natural Integration: Sponsored text woven seamlessly into LLM responses
  • LLM Control: Your LLM decides when and how to weave sponsored content
  • Expandable Details: Users can click to see full information in a modal/panel
  • Non-Disruptive: Appears as natural recommendations, not intrusive ads
  • AdCP Framework: Standardized protocol built on OpenRTB 2.6
  • Engagement-Based: Revenue from user engagement (expansions, clicks)

Compare With:

Use Case Example

User Query: "What are the best family-friendly golf resorts in California?"

AI Response with Sponsored Content:

California has several excellent family-friendly golf resorts:

Pebble Beach Resort offers world-class golf with family amenities including
kids' programs and beach access.

[Palm Springs Golf Resort] features supervised kids' activities while parents
enjoy championship courses designed by Jack Nicklaus, with all-inclusive
packages starting at $299/night.

Torrey Pines in San Diego combines stunning coastal views with excellent
junior golf programs.

User Interaction:

  • Sponsored mentions are subtly highlighted (e.g., gentle background color)
  • Clicking expands to show: full description, images, pricing, booking CTA
  • Non-intrusive: blends naturally with organic recommendations

1. Standardized Integration

  • Built on OpenRTB 2.6 (industry standard for programmatic advertising)
  • No custom integrations needed for each advertiser
  • Works with existing ad tech ecosystem (DSPs, SSPs, ad servers)

2. Flexible Creative Assembly

  • Advertisers provide structured assets (text, images, URLs)
  • Your LLM weaves content naturally into responses
  • Format definitions ensure consistency and quality

3. Privacy-First Design

  • No PII required in bid requests
  • Contextual targeting based on search intent and topics
  • GDPR/CCPA compliant by design

4. Rich Analytics

  • Track impressions (when sponsored content appears)
  • Track expansions (when users click to see more)
  • Track clickthroughs (when users visit advertiser site)
  • Universal macros provide consistent tracking across publishers

5. Quality Control

  • Format specifications define asset requirements
  • Validation ensures quality before serving
  • Your LLM decides relevance and placement

Architecture Overview

Note: The LLM is provided and controlled by the AI Publisher. The AI Publisher uses their own LLM to generate responses and weave sponsored content naturally into search results.

Format Specification

AI Search Sponsored Message Format

Format ID: ai_search_sponsored_message_v1

Type: Contextual weaving with expandable details

Key Features:

  • Brief inline mentions (60-80 characters)
  • Expandable detailed view on click
  • Visual assets (logo, hero image)
  • Pricing information
  • Clear call-to-action

Required Assets

AssetPurposeMax Length
brand_nameBrand identifier for highlighting50 chars
brand_contextBrief description for inline mention300 chars
key_highlightsTop 3 features (pipe-separated)3 items
clickthrough_urlLanding page URL-
impression_trackerImpression tracking URL-
click_trackerClick tracking URL-

Optional Assets

AssetPurposeMax Length
detailed_descriptionFull description for expanded view500 chars
pricing_infoPricing details100 chars
call_to_actionCTA button text30 chars
highlight_keywordsKeywords to emphasize (pipe-separated)5 items
brand_logoLogo image (200x200px)-
hero_imageMain image (600x400px)-
expand_trackerExpansion tracking URL-

OpenRTB Integration

Note: We leverage the OpenRTB standard for forward-compatible protocol integration with the ad ecosystem. However, we do not offer impression-based bidding. The protocol is used for structured communication and asset delivery.

Bid Request Structure

Your platform sends standard OpenRTB 2.6 bid requests with AdCP extensions:

{
"id": "search-req-001",
"imp": [
{
"id": "imp-1",
"ext": {
"aura": {
"adcpFormats": [
{
"agent_url": "https://creative.adcontextprotocol.org",
"id": "ai_search_sponsored_message_v1"
}
]
}
}
}
],
"site": {
"domain": "aisearch.com",
"cat": ["IAB19-30"],
"keywords": "family golf resorts,california,vacation"
},
"ext": {
"aura": {
"intent": {
"value": "information_seeking",
"confidence": 0.92,
"topics": ["family travel", "golf", "california resorts"]
},
"sentiment": {
"value": "positive",
"score": 0.75
}
}
}
}

Key Context Signals:

  • Intent: What the user is trying to accomplish
  • Topics: Extracted from search query
  • Sentiment: User's emotional tone
  • Keywords: Relevant terms for targeting

Bid Response Structure

Advertisers respond with structured assets:

{
"bid": {
"id": "bid-001",
"ext": {
"aura": {
"adcpFormat": {
"formatId": {
"agent_url": "https://creative.adcontextprotocol.org",
"id": "ai_search_sponsored_message_v1"
},
"creativeManifest": {
"promoted_offering": "Palm Springs Golf Resort",
"assets": {
"brand_name": {
"content": "Palm Springs Golf Resort"
},
"brand_context": {
"content": "Award-winning family golf resort with supervised kids' programs and championship Jack Nicklaus course"
},
"key_highlights": {
"content": "Supervised kids' programs|Championship Jack Nicklaus course|All-inclusive from $299/night"
},
"detailed_description": {
"content": "Full resort description with amenities, activities, and family features..."
},
"pricing_info": {
"content": "All-inclusive packages starting at $299/night"
},
"call_to_action": {
"content": "Book Your Family Getaway"
},
"clickthrough_url": {
"url": "https://palmspringsgolf.com/book?campaign={MEDIA_BUY_ID}"
},
"impression_tracker": {
"url": "https://track.brand.com/imp?buy={MEDIA_BUY_ID}&cb={CACHEBUSTER}"
}
}
}
}
}
}
}
}

LLM Integration

Important: The LLM is part of your AI Publisher platform. You control the LLM and its behavior. The following describes how to provide sponsored content to your LLM for natural integration into search responses.

What Your LLM Receives

{
"user_query": "What are the best family-friendly golf resorts in California?",
"sponsored_content": {
"brand_name": "Palm Springs Golf Resort",
"brand_context": "Award-winning family golf resort with supervised kids' programs and championship Jack Nicklaus course",
"key_highlights": [
"Supervised kids' programs",
"Championship Jack Nicklaus course",
"All-inclusive from $299/night"
],
"highlight_keywords": [
"family-friendly",
"championship course",
"supervised kids' activities"
]
}
}

LLM Instructions (Simplified)

Your LLM (which you provide and control) should:

  1. Generate a comprehensive answer with multiple options
  2. Naturally weave the sponsored brand among other legitimate options
  3. Use the exact brand name provided
  4. Incorporate 1-2 key highlights in the description
  5. Keep the inline mention brief (60-80 characters)
  6. Maintain a helpful, informative tone
  7. Avoid words like "sponsored", "ad", or "paid" in the answer

Example LLM Output

California has several excellent family-friendly golf resorts:

**Pebble Beach Resort** offers world-class golf with family amenities.

**Palm Springs Golf Resort** features supervised kids' activities while
parents enjoy championship courses designed by Jack Nicklaus, with
all-inclusive packages starting at $299/night.

**Torrey Pines** combines stunning coastal views with junior golf programs.

User Experience Flow

1. Search Results Display

  • User sees AI-generated answer with multiple options
  • Sponsored mentions are subtly highlighted (gentle background color)
  • Visual treatment is non-intrusive and professional

2. Click to Expand

  • User clicks on highlighted sponsored mention
  • Modal/panel opens showing:
    • Brand logo
    • Hero image
    • Full description
    • Pricing information
    • Call-to-action button

3. Tracking Events

  • Impression: Fired when sponsored content appears in results
  • Expansion: Fired when user clicks to see details
  • Click: Fired when user clicks CTA to visit advertiser site

Benefits for AI Publishers

Revenue Generation

  • Engagement-Based: Revenue tied to user engagement with sponsored content
  • Performance-Focused: Optimize for clicks and conversions
  • Premium Inventory: AI search commands premium rates for quality placements

User Experience

  • Non-Disruptive: Sponsored content blends naturally
  • Relevant: Contextual targeting ensures relevance
  • Valuable: Users get helpful recommendations
  • Transparent: Subtle highlighting indicates sponsored content

Technical Advantages

  • Standard Protocol: OpenRTB 2.6 compatibility
  • Easy Integration: Existing ad tech infrastructure works
  • Flexible: Your LLM controls weaving logic
  • Scalable: Handle millions of requests per day

Analytics & Optimization

  • Rich Metrics: Track impressions, expansions, clicks
  • A/B Testing: Test different weaving strategies
  • Performance Data: Optimize based on engagement
  • Revenue Reporting: Standard IAB metrics

Implementation Considerations

Quality Control

  • Relevance Threshold: Only weave highly relevant sponsored content
  • Frequency Capping: Limit sponsored mentions per session
  • Position Control: Decide where sponsored content appears
  • Fallback Logic: Handle cases with no relevant ads

Privacy & Compliance

  • No PII Required: Contextual targeting only
  • GDPR Compliant: User consent management
  • CCPA Compliant: Privacy string support
  • Transparent: Consider disclosure in expanded view

Performance

  • Low Latency: Bid requests add less than 50ms to response time
  • Caching: Cache format definitions and common assets
  • Async Tracking: Fire tracking pixels asynchronously
  • Graceful Degradation: Handle bid failures gracefully

Product Search Filtering

Overview

The affinity_ai_product_search extension enables publishers to filter product search results by price range, improving ad relevance for user queries. This is particularly useful when users specify budget constraints in their search queries (e.g., "show me iPhones under $900").

Extension Name: affinity_ai_product_search

Location: imp[].ext.affinity_ai_product_search (impression-level)

Applies To: Affillizz Search Product Ad adapter

When to Use Price Filtering

Use the product search extension when:

  • User query includes price constraints ("under 100","100", "50 and above")
  • You want to filter products by budget range
  • Improving relevance for price-sensitive searches
  • Supporting price-based search refinement

Benefits:

  • More relevant product recommendations
  • Better match user intent with available products
  • Improved user satisfaction with search results
  • Higher conversion rates for price-appropriate products

Extension Structure

{
"affinity_ai_product_search": {
"min_price": 800.0,
"max_price": 900.0,
"price_currency": "EUR"
}
}

Field Definitions

FieldTypeRequiredDescription
min_pricefloatNoMinimum product price filter (must be non-negative)
max_pricefloatNoMaximum product price filter (must be non-negative)
price_currencystringNoISO 4217 currency code (e.g., "EUR", "USD") for validation only

Validation Rules:

  • Both min_price and max_price are optional
  • Values must be non-negative (≥ 0)
  • If both set, min_price must be ≤ max_price
  • Invalid values are ignored gracefully (not rejected)
  • price_currency is used for validation only (not sent to API)

Usage Example

Complete OpenRTB Request with Product Search Extension:

{
"id": "bid-request-123",
"imp": [
{
"id": "imp-1",
"native": {
"request": "{\"native\":{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":80}}]}}"
},
"ext": {
"affinity_ai_product_search": {
"min_price": 800.0,
"max_price": 900.0,
"price_currency": "EUR"
},
"aura": {
"adcpFormats": [
{
"agent_url": "https://creative.adcontextprotocol.org",
"id": "ai_search_sponsored_message_v1"
}
]
}
}
}
],
"site": {
"id": "ai-search-sem-text",
"keywords": "iphone 13"
},
"device": {
"language": "de",
"geo": { "country": "DE" }
},
"ext": {
"aura": {
"intent": {
"value": "information_seeking",
"confidence": 0.92,
"topics": ["smartphones", "iphone"]
}
}
}
}

Usage Scenarios

Scenario 1: Price Range Filter (Both Min and Max)

User Query: "Show me iPhones between 800and800 and 900"

{
"imp": [
{
"id": "imp-1",
"native": {
"request": "{\"native\":{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":80}}]}}"
},
"ext": {
"affinity_ai_product_search": {
"min_price": 800.0,
"max_price": 900.0,
"price_currency": "USD"
}
}
}
],
"site": {
"keywords": "iphone"
}
}

Result: Returns products priced between 800and800 and 900

Scenario 2: Minimum Price Only

User Query: "Show me premium headphones $50 and above"

{
"imp": [
{
"id": "imp-1",
"native": {
"request": "{\"native\":{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":80}}]}}"
},
"ext": {
"affinity_ai_product_search": {
"min_price": 50.0,
"price_currency": "USD"
}
}
}
],
"site": {
"keywords": "headphones"
}
}

Result: Returns products priced $50 and above

Scenario 3: Maximum Price Only

User Query: "Show me budget laptops under $500"

{
"imp": [
{
"id": "imp-1",
"native": { "request": "..." },
"ext": {
"affinity_ai_product_search": {
"max_price": 500.0,
"price_currency": "USD"
}
}
}
],
"site": {
"keywords": "laptop"
}
}

Result: Returns products priced under $500

Scenario 4: No Filter (Default Behavior)

User Query: "Show me smartphones"

{
"imp": [
{
"id": "imp-1",
"native": {
"request": "{\"native\":{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":80}}]}}"
}
}
],
"site": {
"keywords": "smartphone"
}
}

Result: Returns products without price filtering (all price ranges)

Best Practices

Extension Usage

  • Optional: Extension is completely optional and backward compatible
  • Graceful: Invalid values are ignored, not rejected
  • Validation: Currency is for validation only (not sent to API)
  • Flexible: Both min and max are optional (use either or both)

Integration

  • Compatible: Works with existing Affinity AI extensions (AdCP, context enhancement)
  • Combinable: Can be combined with other impression-level extensions
  • Per-Impression: Applies per-impression (different filters per ad slot)
  • Adapter-Specific: Only affects Affillizz Search Product Ad adapter

Query Parsing

When parsing user queries for price constraints:

  1. Extract Price Values: Identify numeric price values in query
  2. Detect Range Type: Determine if min, max, or both
  3. Identify Currency: Extract currency from query or use default
  4. Validate Values: Ensure min ≤ max if both present
  5. Add Extension: Include in bid request if price filter detected

Error Handling

  • Missing Extension: Request works normally without extension
  • Invalid Values: Ignored gracefully (e.g., negative prices, min > max)
  • Unknown Currency: Logged but not rejected
  • Partial Data: Min or max alone is valid

Integration Notes

Works With Existing Extensions

The product search extension integrates seamlessly with other Affinity AI extensions:

{
"imp": [
{
"id": "imp-1",
"native": {
"request": "{\"native\":{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":80}}]}}"
},
"ext": {
"affinity_ai_product_search": {
"min_price": 800.0,
"max_price": 900.0,
"price_currency": "EUR"
},
"aura": {
"adcpFormats": [
{
"agent_url": "https://creative.adcontextprotocol.org",
"id": "ai_search_sponsored_message_v1"
}
]
}
}
}
],
"ext": {
"aura": {
"intent": {
"value": "purchase",
"confidence": 0.85
},
"sentiment": {
"value": "positive",
"score": 0.72
}
}
}
}

Per-Impression Filtering

Different ad slots can have different price filters:

{
"imp": [
{
"id": "imp-1",
"native": {
"request": "{\"native\":{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":80}}]}}"
},
"ext": {
"affinity_ai_product_search": {
"max_price": 100.0
}
}
},
{
"id": "imp-2",
"native": {
"request": "{\"native\":{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":80}}]}}"
},
"ext": {
"affinity_ai_product_search": {
"min_price": 500.0
}
}
}
]
}

See Also

ADCP Protocol Components

Context Enhancement

External Standards

Version History

  • v1.0 (2025-11-05): Initial use case guide
    • AI search sponsored message format specification
    • LLM weaving instructions
    • User experience flow (inline → expandable)
    • Implementation phases and best practices

Conclusion

AdCP enables AI publishers to monetize search results through natural, contextual sponsored messages. The standardized approach ensures:

  • Easy Integration: Standard OpenRTB protocol
  • Quality Experience: Non-disruptive, relevant content
  • Strong Revenue: Premium CPMs for AI search inventory
  • Full Control: Your LLM decides when and how to weave

By adopting AdCP for AI search, you can generate significant revenue while maintaining the high-quality user experience your platform is known for.