Skip to main content

AI Search with SEM Text Ads - Technical Overview

⚠️ Important: This use case demonstrates text ads seamlessly integrated with organic search results, not visual product cards or text woven into LLM responses. For visual product ads, see AI Search Product Ads. For LLM text weaving, see AI Search Monetization (LLM Weaving).

πŸ“Ί Live Demo: See this implementation in action at https://demo-aura.affinity.net/ai-search-sem-text

Executive Summary​

This document outlines how AI publishers can integrate SEM (Search Engine Marketing) text ads into search results using standard IAB Native Ads 1.2 format. When users search on your AI platform, the system displays text-based advertisements that appear seamlessly integrated with organic search results, positioned above or alongside the search results.

Key Distinction: These are text ads displayed as search results, similar to Google Ads or Bing Ads. They appear in the same format as organic results but are clearly labeled as advertisements. This differs from visual product cards (which show images and prices) and LLM weaving (which integrates sponsored text into AI-generated responses).

Key Benefits:

  • Seamless Integration: Text ads appear in the same format as organic search results
  • Clear Labeling: Ads are clearly marked with "Ad" label for transparency
  • Industry Standard: Uses OpenRTB 2.6 + IAB Native Ads 1.2 specification
  • Easy Integration: Works with existing ad tech ecosystem (DSPs, SSPs, ad servers)
  • Performance-Based: Revenue from clicks and conversions, not just impressions
  • Privacy-First: Contextual targeting without PII requirements
  • Familiar Format: Users understand the standard search ad format

Compare With:

Use Case Example​

User Query: "travel insurance europe"

Search Results Display:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ [Ad] travelinsurance.com β”‚
β”‚ Best Travel Insurance for Europe | Compare & Save β”‚
β”‚ Get comprehensive travel insurance for your European β”‚
β”‚ trip. Medical coverage, trip cancellation, and more. β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ [Ad] europecover.com β”‚
β”‚ Europe Travel Insurance - Instant Quotes Online β”‚
β”‚ Protect your European vacation with our comprehensive β”‚
β”‚ travel insurance. 24/7 emergency assistance included. β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ [Ad] safetravels.com β”‚
β”‚ European Travel Insurance Plans | Medical & Cancellationβ”‚
β”‚ Affordable travel insurance for Europe. Compare plans β”‚
β”‚ and get covered in minutes. Free quote available. β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

[Organic search results follow below...]

User Interaction:

  • Text ads are displayed above organic search results
  • Each ad shows: display URL, title (clickable), and description
  • Clear "Ad" label distinguishes sponsored from organic results
  • Entire ad is clickable and navigates to the advertiser's landing page
  • Visual format matches organic results for seamless integration

Why IAB Native Ads for SEM Text Ads?​

1. Industry Standard​

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

2. Structured Text Presentation​

  • Advertisers provide structured text data via native assets
  • Ads are displayed as text results, not visual cards
  • Standard asset types ensure consistency and quality
  • Familiar format for users (similar to Google/Bing ads)

3. Privacy-First Design​

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

4. Rich Analytics​

  • Track impressions (when ad appears in results)
  • Track clicks (when users click on ad)
  • Track conversions (when users complete desired actions)
  • Standard tracking mechanisms across all publishers

5. Quality Control​

  • IAB Native specification defines asset requirements
  • Validation ensures quality before serving
  • Your platform decides which ads to display based on relevance

Architecture Overview​

Key Points:

  • AI Publisher provides the search interface - The search platform is part of the AI publisher's platform
  • Affinity AI Bid API provides text ads - standard OpenRTB auction
  • Publisher combines both - displays text ads above organic results
  • Standard tracking - impression and click tracking via OpenRTB

IAB Native Ads Asset Mapping​

SEM Text Ad Native Assets​

Following IAB Native Ads 1.2 specification, SEM text ads use these standard asset types:

Required Assets:

IAB Asset TypeIDData TypePurpose
Title1-Ad headline
Data (Desc)2type: 2Ad description

Optional Assets:

IAB Asset TypeIDData TypePurpose
Data (Sponsor)3type: 1Advertiser name/domain
Data (CTA)4type: 12Call-to-action text

Note: The demo implementation uses a 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,
"data": {
"type": 2,
"len": 300
}
},
{
"id": 3,
"required": 0,
"data": {
"type": 1,
"len": 50
}
},
{
"id": 4,
"required": 0,
"data": {
"type": 12,
"len": 30
}
}
]
}

Key Points:

  • Asset ID 1: Ad title/headline (required, max 100 chars)
  • Asset ID 2: Ad description (required, max 300 chars, data type 2 = description)
  • Asset ID 3: Advertiser name (optional, max 50 chars, data type 1 = sponsored by)
  • Asset ID 4: 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 SEM text ads. Context enhancement extensions are optional and can improve targeting.

Determining Number of Text Ads​

Publishers control how many text ads to request and display by including multiple impression objects in the bid request. Each impression represents one text ad slot.

Best Practices:

  • Start with 2-3 text ad slots for most searches
  • Increase to 4-5 for high-intent commercial queries
  • Reduce to 1-2 for informational queries
  • Monitor fill rates and adjust floor prices accordingly
  • Consider implementing a minimum relevance threshold

Protocol Mechanics: Requesting Multiple Text Ads​

How to Request Multiple Text Ad Slots:

Include one impression object per desired text ad slot in your bid request. Each impression represents one text ad opportunity.

{
"id": "search-req-003",
"imp": [
{"id": "imp-1", "native": {...}},
{"id": "imp-2", "native": {...}},
{"id": "imp-3", "native": {...}}
],
"site": {...},
"device": {...}
}

What You Receive:

Affinity AI returns winning text ads for each impression slot. Each ad in the response references its impression ID:

{
"id": "search-req-003",
"seatbid": [
{
"bid": [
{
"id": "bid-1",
"impid": "imp-1",
"price": 1.5,
"adm": "{...text ad 1}"
},
{
"id": "bid-2",
"impid": "imp-2",
"price": 1.3,
"adm": "{...text ad 2}"
},
{
"id": "bid-3",
"impid": "imp-3",
"price": 1.1,
"adm": "{...text ad 3}"
}
]
}
]
}

Your Control:

After receiving text ads from Affinity AI, you can:

  • Display All: Show all returned text ads
  • Filter: Apply your own relevance or quality filters
  • Limit: Display fewer ads than requested (e.g., request 5, display 3)
  • Order: Sort ads by price, relevance, or your own criteria
  • Diversify: Ensure variety in advertisers

Key Points:

  • One impression = One text ad slot: Request N impressions to get up to N text ads
  • Independent slots: Each impression can return a different text ad
  • Flexible display: You control which ads to show and in what order
  • Standard OpenRTB: Uses standard multi-impression bid request/response

Bid Request Structure​

Your platform sends standard OpenRTB 2.6 bid requests with native ad placement:

{
"id": "ai-search-req-1764003000000",
"imp": [
{
"id": "imp-1",
"native": {
"request": "{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":100}},{\"id\":2,\"required\":1,\"data\":{\"type\":2,\"len\":300}},{\"id\":3,\"required\":0,\"data\":{\"type\":1,\"len\":50}},{\"id\":4,\"required\":0,\"data\":{\"type\":12,\"len\":30}}]}",
"ver": "1.2"
},
"bidfloor": 0.1,
"bidfloorcur": "USD"
}
],
"site": {
"id": "ai-search-sem-text",
"keywords": "travel insurance europe"
},
"device": {
"language": "en",
"geo": {
"country": "US"
}
}
}

Key Request Components:

  • Request ID: Unique identifier for the bid request
  • Impressions: Array of impression objects (one per text ad slot)
  • Native Request: JSON-encoded IAB Native Ads 1.2 specification
  • Site: Publisher site information with keywords for contextual targeting
  • Device: User device and geo information for targeting
  • Bid Floor: Minimum bid (optional)

Optional Context Enhancement:

You can optionally include Affinity AI context enhancement extensions in ext.aura for improved targeting:

{
"ext": {
"aura": {
"intent": {
"value": "purchase_intent",
"confidence": 0.9,
"topics": ["travel", "insurance", "europe"]
}
}
}
}

Bid Response Structure​

Advertisers respond with standard IAB Native Ads 1.2 format:

{
"id": "ai-search-req-1764003000000",
"seatbid": [
{
"seat": "travel-ads-network",
"bid": [
{
"id": "bid-001",
"impid": "imp-1",
"price": 1.5,
"adm": "{\"ver\":\"1.2\",\"link\":{\"url\":\"https://travelinsurance.com/europe\",\"clicktrackers\":[\"https://track.example.com/click?id=123\"]},\"assets\":[{\"id\":1,\"title\":{\"text\":\"Best Travel Insurance for Europe | Compare & Save\"}},{\"id\":2,\"data\":{\"type\":2,\"value\":\"Get comprehensive travel insurance for your European trip. Medical coverage, trip cancellation, and more.\"}},{\"id\":3,\"data\":{\"type\":1,\"value\":\"travelinsurance.com\"}},{\"id\":4,\"data\":{\"type\":12,\"value\":\"Get Quote\"}}],\"imptrackers\":[\"https://track.example.com/imp?id=123\"]}",
"adomain": ["travelinsurance.com"],
"cid": "campaign-456",
"crid": "creative-789",
"cat": ["IAB20-18"],
"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: Landing page URL with optional click trackers
  • Assets:
    • Asset 1 (Title): Ad headline - "Best Travel Insurance for Europe | Compare & Save"
    • Asset 2 (Data/Description): Ad description (data type 2)
    • Asset 3 (Data/Sponsor): Advertiser name - "travelinsurance.com" (data type 1)
    • Asset 4 (Data/CTA): Call-to-action text - "Get Quote" (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 demo parser handles both formats.

Text Ad Display Integration​

Important: Text Ads Are Seamlessly Integrated with Organic Results​

SEM text ads are displayed in the same format as organic search results, positioned ABOVE the organic results. Your platform receives text ad data from Affinity AI and renders them as structured text elements that match the visual style of organic results, with clear "Ad" labeling for transparency.

Parsing Native Ad Response​

Your platform extracts text ad 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) β†’ Ad headline
    • Asset ID 2 (Data type 2) β†’ Ad description
    • Asset ID 3 (Data type 1) β†’ Advertiser name/domain (optional)
    • Asset ID 4 (Data type 12) β†’ Call-to-action text (optional)
    • Link URL β†’ Landing 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 text ads in your UI

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

Rendering Text Ads​

Display each text ad in the same format as organic search results:

  • Display URL: From Asset ID 3 (sponsor) or extracted from landing page URL
  • Ad Label: Clear "Ad" label for transparency
  • Title: From Asset ID 1 (clickable, 2-line clamp for overflow)
  • Description: From Asset ID 2 (3-line clamp for overflow)
  • Clickable Area: Entire ad is clickable, navigates to landing page URL

Example Text Ad Layout:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ travelinsurance.com β”‚
β”‚ [Ad] Best Travel Insurance for Europe | Compare & Save β”‚
β”‚ Get comprehensive travel insurance for your European β”‚
β”‚ trip. Medical coverage, trip cancellation, and more. β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Accessibility Features:

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

Tracking Implementation​

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

  • Impression Trackers: When text ad becomes 50% visible in viewport (Intersection Observer)
  • Click Trackers: When user clicks on text ad (max 50ms 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 ad per session (tracked in sessionStorage)
  • Fires impression before click if not already fired
  • All tracking URLs validated as HTTPS
  • Graceful degradation if tracking fails

User Experience Flow​

1. Search Results Display​

  • User enters search query in search box
  • Text ads are displayed ABOVE organic search results
  • Each text ad shows: display URL, "Ad" label, title (clickable), description
  • Entire ad is clickable for better UX
  • Clear visual separation with "Ad" label for transparency
  • Seamless integration with organic results format
  • Loading state shown while fetching ads

2. Click to Landing Page​

  • User clicks anywhere on text ad
  • Click trackers fire (max 50ms wait)
  • Opens landing page URL in new tab
  • Impression tracker fires first if not already fired
  • User lands on advertiser site to complete desired action

3. Tracking Events​

  • Impression: Fired when text ad becomes 50% visible in viewport (once per session)
  • Click: Fired when user clicks text ad (max 50ms delay)
  • Win Notice: Fired immediately after bid response with auction price

4. Error Handling​

  • Graceful degradation if no ads returned
  • Error message displayed if API fails
  • No mock data fallback - real API only

Benefits for AI Publishers​

Revenue Generation​

  • Performance-Based: Revenue tied to clicks and conversions
  • High Intent: Search queries indicate strong intent
  • Premium CPCs: SEM text ads command competitive rates
  • Standard Tracking: Industry-standard impression and click tracking

User Experience​

  • Seamless Integration: Text ads match organic results format
  • Clear Labeling: "Ad" label provides transparency
  • Relevant: Context enhancement ensures ad relevance
  • Familiar: Users understand standard search ad format
  • Non-Disruptive: Ads blend naturally with search results

Technical Advantages​

  • Industry Standard: OpenRTB 2.6 + IAB Native Ads 1.2
  • Easy Integration: Works with existing ad tech infrastructure
  • Separation of Concerns: Search provides results; UI renders text ads
  • Scalable: Handle millions of searches 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 presentation strategies
  • Performance Data: Optimize based on click-through rates
  • Revenue Reporting: Standard programmatic advertising metrics

Implementation Considerations​

Quality Control​

  • Relevance Threshold: Only show highly relevant text ads
  • Asset Validation: Ensure all required native assets are present (title, description)
  • HTTPS Validation: All URLs (landing pages, trackers) must be HTTPS
  • XSS Prevention: Sanitize all text content before rendering
  • Flexible Parsing: Handle both wrapped and unwrapped native response formats
  • Performance: Target <50ms per text ad parsing

Privacy & Compliance​

  • No PII Required: Contextual targeting only
  • GDPR Compliant: User consent management
  • CCPA Compliant: Privacy string support
  • IAB Guidelines: Follow IAB Native Ads disclosure requirements
  • Clear Labeling: Mark ads with "Ad" label for transparency

Performance​

  • Low Latency: 500ms timeout for bid requests
  • Async Tracking: Fire tracking pixels asynchronously with sendBeacon
  • Graceful Degradation: Handle no-bid responses gracefully
  • Performance Targets:
    • Bid request construction: <10ms
    • Bid API response: <500ms
    • Text ad parsing: <50ms per ad
    • Impression tracking: <100ms
    • Click tracking: <50ms
    • Page load: <2s complete SERP

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

Demo Implementation​

A complete working demo is available at https://demo-aura.affinity.net/ai-search-sem-text:

Features:

  • Real Affinity AI Bid API integration (no mock data)
  • Default search query: "travel insurance europe"
  • IAB Native Ads 1.2 format parsing
  • Text ads seamlessly integrated with organic results
  • Intersection Observer impression tracking
  • Click tracking with sendBeacon
  • WCAG 2.1 AA accessibility compliance

Demo Limitations:

  • Simulated organic search results (skeleton placeholders)
  • Default search query pre-populated
  • Mock sidebar content

Real Implementation:

  • Affinity AI Bid API integration
  • OpenRTB 2.6 protocol
  • IAB Native Ads 1.2 parsing
  • Impression/click tracking
  • Text ad data from real advertisers

OpenRTB Components​

Context Enhancement​

External Standards​

Version History​

  • v1.0 (2025-12-12): Initial use case guide
    • SEM text ads with IAB Native Ads 1.2 specification
    • Seamless integration with organic search results
    • Clear "Ad" labeling for transparency
    • Demo implementation details and limitations
    • Tracking implementation details
    • Accessibility features
    • Flexible asset mapping approach
    • Performance targets

Conclusion​

IAB Native Ads enable AI publishers to monetize search queries through standard SEM text ads. This approach ensures:

  • Industry Standard: OpenRTB 2.6 + IAB Native Ads 1.2
  • Easy Integration: Works with all major ad platforms
  • Seamless Integration: Text ads match organic results format
  • Clear Transparency: "Ad" label provides user transparency
  • Strong Revenue: Performance-based monetization
  • Familiar Format: Users understand standard search ad format
  • Context Enhancement: Optional rich targeting signals improve relevance
  • Accessibility: WCAG 2.1 AA compliant

By using standard IAB Native Ads 1.2 with optional context enhancement, you can generate revenue from search queries while maintaining a high-quality user experience, clear transparency, and broad compatibility with the advertising ecosystem.