Ad Ranking & Placement

How Ads Are Ranked

RankFlow uses a sophisticated ranking system that combines multiple factors to ensure ads are both relevant and effective:

Semantic Matching

Using RankFlow's vector search capabilities, ads are ranked based on their semantic similarity to the user's query. This ensures that ads are contextually relevant to the conversation.

// Example of semantic matching
const relevantAds = await rankflow.getAds({
  query: userQuery,
  semanticThreshold: 0.85, // Minimum similarity score
});

Performance Metrics

Ads are ranked based on a combination of relevance and engagement using the following factors:

  • Semantic Similarity – How closely the ad content matches the user query using AI-driven embeddings.
  • Meaning Similarity – Context-aware ranking that ensures ads align with user intent.
  • Click-Through Rate (CTR) – Measures how often users click on an ad after seeing it.
  • Engagement Score – A weighted score based on clicks, impressions, and interaction time.
  • Historical Performance – Prior ad performance data influencing ranking decisions.
  • Budget & Spend – Ensures ads are served within the advertiser's allocated budget.
  • Relevance & Engagement Weighting – Developers can fine-tune ranking using customizable weights.

Customization Options

RankFlow allows developers to fine-tune ad retrieval based on relevance, engagement, and the number of ads displayed. Below is an example of how to fetch ads using custom parameters:

async function fetchAds() {
  try {
    const adResponse = await rankflow.getAds({
      query: "crypto trading bot", // The search term used to match relevant ads
      relevanceWeight: 0.3, // Adjusts how much importance is given to ad relevance
      engagementWeight: 0.1, // Adjusts how much importance is given to user engagement metrics
      numberOfAds: 3, // Defines how many ads should be retrieved
    });

    console.log("Relevant Ads:", adResponse);
  } catch (error) {
    console.error(error);
  }
}

In the above example:

  • query: The search term that determines ad relevance.
  • relevanceWeight: Affects how much ad relevance influences the ranking.
  • engagementWeight: Adjusts the ranking based on past user engagement data.
  • numberOfAds: Controls the number of ads returned in the response.

By tweaking these parameters, developers can optimize ad placements for their specific use case.

Best Practices

  • Maintain a balance between ad relevance and quantity
  • Test different placement strategies for optimal engagement
  • Monitor performance metrics to optimize ad selection
  • Use content-style matching for natural ad integration