Skip to content

Best Practices

Keyword Selection

Quality Over Quantity

Provide specific, relevant keywords to ensure the most contextually appropriate ads are served:

  • Be Specific: Instead of generic terms like "technology", use specific terms like "smartphone", "Android", or "iPhone"
  • Include Context: Include keywords that provide context (e.g., "buying", "comparing", "reviewing")
  • Limit Keywords: Focus on 5-10 of the most relevant keywords rather than an exhaustive list

User Experience

Ad Placement

  • Natural Integration: Display ads in a way that enhances rather than disrupts the user experience
  • Timing: Show ads at natural breaks in conversation or when they're most relevant to the topic
  • Transparency: Clearly mark content as advertising (the "Powered by Mosaic" tag helps with this)

Response Handling

  • Graceful Fallbacks: Have a plan for when no relevant ads are available
  • Performance: Cache API responses when appropriate to minimize latency
  • Error Handling: Implement robust error handling to prevent disruptions to your service

Privacy Considerations

Data Minimization

  • Only Share What's Needed: Share user location and device information if available. Refrain from sharing PII
  • Transparency: Be transparent with users about ad serving and data sharing
  • Opt-Out Options: Consider providing options for users to opt out of personalized ads

Technical Implementation

API Usage

  • Caching: Cache ad responses for short periods (e.g., 5-15 minutes) to reduce API calls
  • Rate Limiting: Implement client-side rate limiting to prevent excessive API calls
  • Retry Logic: Use exponential backoff for retries on 5xx errors

Tracking Implementation

  • Preserve Tracking Links: Always use the provided campaign_link for clicks to ensure proper tracking
  • Markdown Rendering: Ensure your markdown renderer correctly handles the provided campaign_markdown
  • Image Handling: Ensure images are displayed correctly and at appropriate sizes

Testing and Monitoring

Regular Testing

  • Keyword Variations: Test with different keyword combinations to ensure ads are being matched correctly
  • Edge Cases: Test with empty or invalid inputs to ensure graceful error handling

Performance Monitoring

  • Latency: Monitor API call latency and optimize if necessary
  • Success Rate: Track the percentage of requests that successfully return ads
  • User Engagement: Monitor click-through rates to gauge ad relevance and placement effectiveness

Optimization

Continuous Improvement

  • A/B Testing: Experiment with different ad placements and formats
  • User Feedback: Collect and analyze user feedback on ad relevance and intrusiveness

Revenue Optimization

  • Strategic Placement: Place ads where they're most likely to be relevant and clicked
  • Timing: Show ads when users are most receptive to them