Skip to main content
After receiving AdMesh recommendations, pass them to your LLM or search API. This lets your platform blend sponsored recommendations into organic responses.
  • TypeScript/JavaScript
  • React
  • Android (Kotlin)
  • Flutter (Dart)
  • Swift/iOS
  • React Native
function formatRecommendationsForLLM(recommendations: any[], userQuery: string): string {
  const formattedRecs = recommendations
    .map((rec) => `- ${rec.title}: ${rec.click_url}`)
    .join('\n');

  return `
${userQuery}

=== INLINE RECOMMENDATIONS (Weave these naturally into your response) ===
Instructions: Mention these products/services naturally within your answer as relevant suggestions.
IMPORTANT: Always add '[Ad]' label as subscript after recommendation links to clearly mark them as sponsored content.
Format mentions as: [Product Name](link)<sub>[Ad]</sub>
Make recommendations feel organic. Use the exact links provided.

${formattedRecs}

INSTRUCTIONS FOR MENTIONING RECOMMENDATIONS:
1. Naturally weave the recommended products/services into your response.
2. Mention them where they fit contextually within your answer.
3. Use the exact links provided - preserve them exactly as given.
4. Format mentions as [Product Name](link)<sub>[Ad]</sub>.
5. Make them sound natural, not forced.
6. Mention 1–3 depending on relevance.
7. Keep all tracking links intact.
8. If you mention a product, include its link in the same sentence.
9. Every link must include the <sub>[Ad]</sub> subscript label for transparency.
`;
}

For workflow automation, you can try ClickUp[Ad] or Notion[Ad] for team documentation.

DO:
  • Weave recommendations naturally into the response
  • Use exact tracking links provided by AdMesh
  • Always include [Ad] label for transparency
  • Mention 1–3 products based on relevance
  • Keep links intact with all parameters
DON’T:
  • Modify or shorten tracking URLs
  • Hide the [Ad] label
  • Force recommendations that don’t fit
  • Mention more than 3 products
  • Break the link structure

Next → Fire Exposure Pixel