Skip to main content

AI Chat with Product Listing Ads - Technical Overview

⚠️ Important: This use case demonstrates conversational AI chat interfaces with embedded Product Listing Ads. Users interact with a chat assistant that provides natural language responses with product recommendations displayed as compact horizontal cards within the conversation flow.

Live Demo

A complete working demo is available at https://demo-aura.affinity.net/ai-chat-pla showing real Affinity AI Bid API integration with IAB Native Ads 1.2 format.

Note: The demo uses simplified pattern matching for keyword extraction. Production implementations should use LLM-powered intent extraction.

Executive Summary

This document outlines how publishers can integrate Product Listing Ads into conversational AI chat experiences using standard IAB Native Ads 1.2 format with OpenRTB 2.6. Users ask natural language questions about products, and the system responds with helpful information alongside relevant product ads displayed as compact cards embedded within chat messages.

Key Benefits:

  • Conversational Discovery: Natural language product search within chat interface
  • Natural Language Price Filtering: Extract price constraints from queries like "under $200"
  • Embedded Product Cards: Compact horizontal cards within chat messages, not separate sections
  • Industry Standard: Uses OpenRTB 2.6 + IAB Native Ads 1.2 specification
  • Easy Integration: Works with existing ad tech ecosystem (DSPs, SSPs, ad servers)
  • Streaming Responses: Word-by-word text streaming for responsive UX
  • Privacy-First: Contextual targeting without PII requirements
  • Engagement-Based: Revenue from clicks and conversions on product cards

Compare With:

Use Case Example

User Query: "What are the best bluetooth speakers under $200?"

Chat Response with Products:

┌──────────────────────────────────────────────────────────────┐
│ You: What are the best bluetooth speakers under $200? │
└──────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────┐
│ 🤖 Assistant: │
│ │
│ When choosing a bluetooth speaker under $200, consider │
│ key features like sound quality, battery life, and │
│ portability. Look for waterproof ratings if you plan to │
│ use it outdoors. Here are some options available: │
│ │
│ ┌────────────────────────────────────────────────────┐ │
│ │ [Image] JBL Flip 6 $129.99 [View] → │ │
│ │ Amazon │ │
│ └────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────────┐ │
│ │ [Image] Sony SRS-XB43 $178.00 [View] → │ │
│ │ Best Buy │ │
│ └────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────────┐ │
│ │ [Image] Bose SoundLink $149.99 [View] → │ │
│ │ Target │ │
│ └────────────────────────────────────────────────────┘ │
│ │
│ Compare features like battery life, audio codecs, and │
│ connectivity options to find the best fit for your needs. │
└──────────────────────────────────────────────────────────────┘

User Interaction:

  • User asks question in natural language with price constraint
  • System extracts keywords ("bluetooth speakers") and price filter ("under $200")
  • Assistant response streams word-by-word
  • Product cards appear embedded within the chat message
  • Each card shows: image, title, price, merchant, CTA button
  • Entire card is clickable and navigates to merchant's product page
  • Impression tracked when card is 50% visible
  • Click tracked when user clicks on card

Why IAB Native Ads for Chat Products?

1. Industry Standard

  • Built on OpenRTB 2.6 and IAB Native Ads 1.2 specification
  • No custom integrations needed for each retailer or brand
  • Works with existing ad tech ecosystem (DSPs, SSPs, ad servers)
  • Broad support across the advertising industry

2. Structured Product Data

  • Retailers provide structured product data via native assets
  • Products displayed as compact cards within chat messages
  • Standard asset types ensure consistency and quality
  • Easy to render in any chat interface

3. Price Filter Extension

  • Custom affinity_ai_product_search extension for price filtering
  • Extract constraints from natural language
  • Filter products at bid request time
  • Improves relevance and user satisfaction

4. LLM-Driven Intent Extraction

  • Your LLM intelligently extracts user intent from natural language queries
  • Identifies product keywords and price constraints automatically
  • Calls Affinity AI Bid API with extracted parameters
  • Generates helpful response text independent of auction results

5. Privacy-First Design

  • No PII required in bid requests
  • Contextual targeting based on chat query and keywords
  • GDPR/CCPA compliant by design

6. Rich Analytics

  • Track impressions (when product card becomes visible)
  • Track clicks (when users click on product cards)
  • Track conversions (when users make purchases)
  • Standard tracking mechanisms across all publishers

7. Quality Control

  • IAB Native specification defines asset requirements
  • Validation ensures quality before serving
  • Affinity AI Bid API returns relevant products based on keywords and price filter

Architecture Overview

Key Points:

  • LLM extracts intent - Your AI intelligently extracts keywords and price constraints from natural language
  • LLM calls Affinity AI Bid API - Uses extracted parameters to request relevant product ads via OpenRTB
  • Affinity AI Bid API returns ads - Standard OpenRTB auction returns product listings in IAB Native 1.2 format
  • LLM generates response - Creates helpful text response independent of the specific products returned
  • Chat interface renders - Displays LLM text response with embedded product cards
  • Standard tracking - Impression and click tracking via OpenRTB

Natural Language Price Filtering

Supported Price Patterns

The system can extract price constraints from natural language queries:

Pattern Types:

PatternExample QueriesExtracted Filter
Under"under 200","below200", "below 150"max_price: 200
Over"over 50","above50", "above 100"min_price: 100
Between"between 100and100 and 200"min_price: 100, max: 200
Around"around $150" (±20% range)min: 120, max: 180
Less than"less than $100"max_price: 100
At least"at least $75"min_price: 75
Range"100to100 to 200"min: 100, max: 200

Price Filter Extension

The extracted filter is sent to Affinity AI Bid API via the affinity_ai_product_search extension:

{
"imp": [
{
"id": "imp-1",
"native": {...},
"ext": {
"affinity_ai_product_search": {
"max_price": 200.0,
"price_currency": "USD"
}
}
}
]
}

Benefits:

  • Improves product relevance by filtering at auction time
  • Reduces unnecessary product returns
  • Better user experience with price-appropriate products
  • Supports any currency (USD, EUR, GBP, etc.)

IAB Native Ads Asset Mapping

Product Listing Native Assets

Following IAB Native Ads 1.2 specification, chat product listings use these standard asset types:

Required Assets:

IAB Asset TypeIDData TypePurpose
Title1-Product name
Image (Main)2type: 3Product image
Data (Price)3type: 3Product price

Optional Assets:

IAB Asset TypeIDData TypePurpose
Data (Desc)4type: 2Product description
Data (Sponsor)5type: 1Merchant/brand name
Data (CTA)6type: 12Call-to-action text

Note: The implementation uses flexible asset mapping that checks both asset IDs and data types for compatibility with different bidders.

Native Request Structure

The native request follows IAB Native Ads 1.2 specification:

{
"ver": "1.2",
"assets": [
{
"id": 1,
"required": 1,
"title": {
"len": 100
}
},
{
"id": 2,
"required": 1,
"img": {
"type": 3,
"w": 300,
"h": 250
}
},
{
"id": 3,
"required": 1,
"data": {
"type": 3,
"len": 50
}
},
{
"id": 4,
"required": 0,
"data": {
"type": 2,
"len": 200
}
},
{
"id": 5,
"required": 0,
"data": {
"type": 1,
"len": 50
}
},
{
"id": 6,
"required": 0,
"data": {
"type": 12,
"len": 30
}
}
]
}

Key Points:

  • Asset ID 1: Product title (required, max 100 chars)
  • Asset ID 2: Product image (required, 300x250px, type 3 = main image)
  • Asset ID 3: Price (required, max 50 chars, data type 3 = price)
  • Asset ID 4: Description (optional, max 200 chars, data type 2 = description)
  • Asset ID 5: Merchant name (optional, max 50 chars, data type 1 = sponsored by)
  • Asset ID 6: CTA text (optional, max 30 chars, data type 12 = CTA)

OpenRTB Integration

Note: We use standard OpenRTB 2.6 with IAB Native Ads 1.2 for product listings with the affinity_ai_product_search extension for price filtering.

Bid Request Structure

Your chat platform sends standard OpenRTB 2.6 bid requests with native ad placement and price filter:

{
"id": "ai-chat-pla-req-1704123456789",
"imp": [
{
"id": "imp-1",
"native": {
"request": "{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":100}},{\"id\":2,\"required\":1,\"img\":{\"type\":3,\"w\":300,\"h\":250}},{\"id\":3,\"required\":1,\"data\":{\"type\":3,\"len\":50}},{\"id\":4,\"required\":0,\"data\":{\"type\":2,\"len\":200}},{\"id\":5,\"required\":0,\"data\":{\"type\":1,\"len\":50}},{\"id\":6,\"required\":0,\"data\":{\"type\":12,\"len\":30}}]}",
"ver": "1.2"
},
"ext": {
"affinity_ai_product_search": {
"max_price": 200.0,
"price_currency": "USD"
}
}
},
{
"id": "imp-2",
"native": {...},
"ext": {
"affinity_ai_product_search": {
"max_price": 200.0,
"price_currency": "USD"
}
}
},
{
"id": "imp-3",
"native": {...},
"ext": {
"affinity_ai_product_search": {
"max_price": 200.0,
"price_currency": "USD"
}
}
}
],
"site": {
"id": "ai-chat-pla",
"keywords": "bluetooth speaker,wireless speaker"
},
"device": {
"language": "en",
"geo": {
"country": "US"
}
}
}

Key Request Components:

  • Request ID: Unique identifier for the bid request
  • Impressions: Array of impression objects (typically 3 for chat product cards)
  • Native Request: JSON-encoded IAB Native Ads 1.2 specification
  • Price Filter Extension: affinity_ai_product_search with price constraints
  • Site Keywords: Extracted keywords from user query for contextual targeting
  • Device: User device and geo information for targeting

Determining Number of Product Cards

Publishers control how many product cards to request and display:

Best Practices:

  • Start with 3 product cards for most queries
  • Consider query complexity and screen size
  • Mobile: 2-3 cards work well
  • Desktop: 3-5 cards can be displayed
  • Monitor engagement rates and adjust

Bid Response Structure

Retailers respond with standard IAB Native Ads 1.2 format:

{
"id": "ai-chat-pla-req-1704123456789",
"seatbid": [
{
"seat": "affilizz-products",
"bid": [
{
"id": "bid-001",
"impid": "imp-1",
"price": 1.8,
"adm": "{\"native\":{\"ver\":\"1.2\",\"link\":{\"url\":\"https://amazon.com/product?ref=aura\",\"clicktrackers\":[\"https://track.example.com/click?id=123\"]},\"assets\":[{\"id\":1,\"title\":{\"text\":\"JBL Flip 6 Bluetooth Speaker\"}},{\"id\":2,\"img\":{\"url\":\"https://cdn.example.com/jbl-flip-6.jpg\",\"w\":300,\"h\":250}},{\"id\":3,\"data\":{\"type\":3,\"value\":\"129.99 USD\"}},{\"id\":4,\"data\":{\"type\":2,\"value\":\"Portable waterproof speaker with 12 hours of playtime\"}},{\"id\":5,\"data\":{\"type\":1,\"value\":\"Amazon\"}},{\"id\":6,\"data\":{\"type\":12,\"value\":\"View Product\"}}],\"imptrackers\":[\"https://track.example.com/imp?id=123\"]}}",
"adomain": ["amazon.com"],
"cid": "campaign-123",
"crid": "creative-456",
"cat": ["IAB19-6"],
"nurl": "https://track.example.com/win?price=${AUCTION_PRICE}"
}
]
}
],
"cur": "USD"
}

Native Response Breakdown:

The adm field contains a JSON-encoded IAB Native Ads 1.2 response:

  • Link: Product URL with optional click trackers
  • Assets:
    • Asset 1 (Title): Product name - "JBL Flip 6 Bluetooth Speaker"
    • Asset 2 (Image): Product image URL (300x250px)
    • Asset 3 (Data/Price): Price with currency - "129.99 USD" (data type 3)
    • Asset 4 (Data/Description): Product description (data type 2)
    • Asset 5 (Data/Sponsored): Merchant name - "Amazon" (data type 1)
    • Asset 6 (Data/CTA): Call-to-action text - "View Product" (data type 12)
  • Impression Trackers: Array of impression tracking URLs
  • Win Notice (nurl): URL with ${AUCTION_PRICE} macro for win notification

Important: The native response can be in the adm field directly or wrapped in a native object for legacy compatibility. The parser handles both formats.

Product Display Integration

Important: Products Are Embedded in Chat Messages

Product cards are displayed as compact horizontal cards WITHIN chat messages, NOT as separate sections. Your platform receives product data from Affinity AI and renders them as embedded cards in the assistant's response message.

Parsing Native Ad Response

Your platform extracts product information from the IAB Native Ads 1.2 assets:

  1. Parse the JSON-encoded adm field from the bid response
  2. Handle both wrapped ({native: {...}}) and unwrapped formats
  3. Extract native assets by ID and data type:
    • Asset ID 1 (Title) → Product name
    • Asset ID 2 (Image) → Product image URL
    • Asset ID 3 (Data type 3) → Price with currency
    • Asset ID 4 (Data type 2) → Product description (optional)
    • Asset ID 5 (Data type 1) → Merchant name (optional)
    • Asset ID 6 (Data type 12) → Call-to-action text (optional, defaults to "View Product")
    • Link URL → Product page URL
    • Impression trackers → Array of tracking URLs
    • Click trackers → Array of tracking URLs
  4. Validate all URLs are HTTPS
  5. Sanitize text content to prevent XSS
  6. Render products as compact horizontal cards in chat message

Implementation Note: Use flexible asset mapping that checks both asset IDs and data types for compatibility with different bidders.

Rendering Product Cards

Display each product as a compact horizontal card embedded in chat message:

  • Horizontal Layout: Image on left, details on right
  • Compact Size: Fits naturally within chat flow
  • Product Image: From Asset ID 2 (fixed height, auto width)
  • Product Title: From Asset ID 1 (1-2 line clamp for overflow)
  • Price: From Asset ID 3 (bold, prominent display)
  • Merchant: From Asset ID 5 (small text)
  • CTA Button: From Asset ID 6, defaults to "View Product"
  • Clickable Card: Entire card is clickable, navigates to product URL

Example Product Card Layout:

┌────────────────────────────────────────────────┐
│ [Image] JBL Flip 6 Bluetooth Speaker │
│ 80x60px $129.99 │
│ Amazon [View Product →]│
└────────────────────────────────────────────────┘

Responsive Design:

  • Desktop: Cards stack vertically with 8px gap
  • Mobile: Same layout, optimized for touch
  • Hover State: Subtle elevation effect on desktop

Accessibility Features:

  • WCAG 2.1 AA compliant
  • Keyboard navigation (Tab, Enter)
  • Screen reader support with ARIA labels
  • Focus indicators
  • High contrast mode support

Tracking Implementation

Fire tracking pixels at appropriate times using navigator.sendBeacon() with image pixel fallback:

  • Impression Trackers: When product card becomes 50% visible in viewport (Intersection Observer)
  • Click Trackers: When user clicks on product card (max 200ms wait before navigation)
  • Win Notice (nurl): Immediately after receiving bid response with ${AUCTION_PRICE} macro replaced

Implementation Details:

  • Uses Intersection Observer API with 0.5 threshold (50% visibility)
  • Fires impression only once per product per session (tracked in sessionStorage)
  • Fires impression before click if not already fired
  • All tracking URLs validated as HTTPS
  • Graceful degradation if tracking fails

Integration Workflow

1. LLM Extracts User Intent

Your LLM processes the user's natural language query and extracts:

  • Keywords: Product-related terms for contextual targeting
  • Price Constraints: Budget limits expressed in natural language
  • Intent: Determines if this warrants a product search

Example: "best bluetooth speakers under $200"

  • Keywords: ["bluetooth speaker", "wireless speaker"]
  • Price Filter: max_price: 200, currency: USD

2. Build OpenRTB Bid Request

Construct a standard OpenRTB 2.6 bid request with:

  • Native placement (IAB Native Ads 1.2)
  • Keywords in site.keywords field
  • Price filter in imp[].ext.affinity_ai_product_search
  • Multiple impressions (one per product slot)

See Bid Request Structure section for complete example.

3. Call Affinity AI Bid API

Send the bid request to Affinity AI Bid API endpoint. The API will:

  • Run a real-time auction with product advertisers
  • Apply the price filter at auction time
  • Return up to N products (one per impression requested)
  • Include tracking URLs for impressions and clicks

4. API Returns Product Ads

Affinity AI Bid API responds with:

  • Native ads in IAB Native Ads 1.2 format
  • Product assets: title, image, price, merchant, CTA
  • Tracking URLs: impression trackers, click trackers, win notice
  • Metadata: auction price, advertiser domain, categories

See Bid Response Structure section for complete example.

5. Render Products in Chat

Your platform renders the products:

  • Parse native assets from the response
  • Display products as cards embedded in chat message
  • Make cards clickable linking to product URLs
  • Implement tracking (impressions and clicks)

See Product Display Integration section for parsing details.

6. Fire Tracking Pixels

Fire the provided tracking URLs at appropriate times:

  • Win Notice (nurl): Immediately after receiving bid response
  • Impression Trackers: When product becomes visible to user
  • Click Trackers: When user clicks on product

Use navigator.sendBeacon() or image pixel fallback for reliability.

Benefits for Chat Publishers

Revenue Generation

  • Engagement-Based: Revenue tied to clicks and conversions
  • High Intent: Product queries indicate strong purchase intent
  • Premium CPCs: Product listing ads command premium rates
  • Standard Tracking: Industry-standard impression and click tracking
  • Natural Integration: Products embedded in conversation flow

User Experience

  • Conversational: Natural language product discovery
  • Price-Aware: Respects user's stated budget constraints
  • Helpful: Educational content alongside product options
  • Embedded: Products feel like part of the conversation
  • Streaming: Responsive word-by-word text display

Technical Advantages

  • Industry Standard: OpenRTB 2.6 + IAB Native Ads 1.2
  • Easy Integration: Works with existing ad tech infrastructure
  • Price Filtering: Natural language price constraint extraction
  • Scalable: Handle millions of chat queries per day
  • Broad Support: Compatible with all major ad platforms

Analytics & Optimization

  • Standard Metrics: Track impressions, clicks via IAB mechanisms
  • A/B Testing: Test different card layouts and response styles
  • Performance Data: Optimize based on click-through rates
  • Revenue Reporting: Standard programmatic advertising metrics

Implementation Considerations

Quality Control

  • Relevance Threshold: Only show highly relevant products
  • Asset Validation: Ensure all required native assets are present (title, image, price)
  • HTTPS Validation: All URLs (images, product links, trackers) must be HTTPS
  • XSS Prevention: Sanitize all text content before rendering
  • Image Quality: Validate image URLs are accessible
  • Flexible Parsing: Handle both wrapped and unwrapped native response formats
  • Performance: Target <50ms per product parsing

Privacy & Compliance

  • No PII Required: Contextual targeting only
  • GDPR Compliant: User consent management
  • CCPA Compliant: Privacy string support
  • Transparent: Clear presentation as sponsored products
  • Session Storage: Tracking state limited to session only

Performance

  • API Timeout: Set appropriate timeout for bid requests (recommended: 500ms for production)
  • Async Tracking: Fire tracking pixels asynchronously to avoid blocking user interactions
  • Graceful Degradation: Handle no-bid responses (empty seatbid array) gracefully
  • Recommended Targets:
    • Bid request construction: <10ms
    • Bid API call: <500ms timeout
    • Product parsing: <50ms per product
    • Impression tracking: fire asynchronously, don't block rendering
    • Click tracking: fire asynchronously, don't delay navigation

Native Ad Parsing

  • JSON Parsing: Properly parse JSON-encoded adm field
  • Format Compatibility: Handle both wrapped ({native: {...}}) and unwrapped formats
  • Flexible Asset Mapping: Check both asset IDs and data types for compatibility
  • Error Handling: Handle missing or malformed assets gracefully
  • Validation: Validate native response structure and required fields
  • HTTPS Enforcement: Reject non-HTTPS URLs
  • XSS Prevention: Sanitize all text content
  • No Fallback: Real API only, no mock data

API Response Handling

No-Bid Scenarios

The API may return no bids in several scenarios:

  • No products match the keywords and price filter
  • All products filtered out by price constraints
  • No advertisers bidding at this time
  • Query doesn't match any product categories

Response: Empty seatbid array or no seatbid field

{
"id": "ai-chat-pla-req-1704123456789",
"seatbid": [],
"cur": "USD"
}

Handling: Your platform should gracefully handle this case without showing product cards.

Partial Bids

The API may return fewer products than requested impressions:

  • Requested 3 impressions, received 2 bids
  • Some impression slots had no matching products

Handling: Display only the products returned, don't show empty placeholders.

Error Responses

If the API returns an error, handle it gracefully with appropriate error logging and user feedback.

OpenRTB Components

Context Enhancement

External Standards

Version History

  • v2.0 (2026-01-14): Updated based on actual demo implementation
    • Complete rewrite to match actual ai-chat-pla feature implementation
    • Added natural language price filtering with affinity_ai_product_search extension
    • Added OpenRTB 2.6 + IAB Native Ads 1.2 technical details
    • Documented compact horizontal product card layout
    • Added streaming response implementation details
    • Updated architecture to show keyword/price extraction flow
    • Clarified demo limitations vs production requirements
    • Added integration guide for customers
    • Followed documentation style from other use cases
  • v1.0 (2025-XX-XX): Initial generic documentation
    • Original MCP-focused documentation

Conclusion

IAB Native Ads enable chat publishers to monetize conversational product discovery through standard, embedded product listing ads. This approach ensures:

  • Industry Standard: OpenRTB 2.6 + IAB Native Ads 1.2
  • Easy Integration: Works with all major ad platforms
  • Conversational: Natural language product queries with price filtering
  • Embedded Experience: Products naturally integrated within chat flow
  • Streaming Responses: Word-by-word text display for responsive UX
  • Strong Revenue: Performance-based monetization with high-intent queries
  • Price-Aware: Natural language price constraint extraction
  • Responsive Design: Adapts to desktop and mobile

By using standard IAB Native Ads 1.2 with natural language price filtering, you can generate revenue from conversational product discovery while maintaining a high-quality user experience and broad compatibility with the advertising ecosystem.