Integrating Sponsored Prompts
This guide provides comprehensive instructions on integrating sponsored prompts within your conversational AI. It covers essential aspects such as environment modes, tracking and more.Production vs. Sandbox Mode
Important: When integrating sponsored prompts, it’s crucial to
distinguish between production and sandbox (non-production) environments. - In
sandbox mode (
production=False), ads are returned for testing purposes
but are not counted for monetization. - In production mode
(production=True), ads are live and contribute to monetization. Always
ensure production=True is used only in your live production environment.
For all testing and development, set production=False.Using Sponsored Prompts
Sponsored prompts can be incorporated into your AI conversations in two primary ways: as an initial opener or as contextual follow-up questions.- Sponsored Opener
- Sponsored Follow-up
Starting Conversations with Sponsored Openers
You can use the sponsored question endpoint to generate an “opener” – a question to initiate a conversation.Key Points:- No Context Needed: Simply call the endpoint without any prior conversational context.
- Tailored for Your App: The API will provide a sponsored question suitable for your application, yet conversation-agnostic.
- Unaffected by
conversationalOffsetandadFrequencyandforce: These parameters do not influence the behavior of opener prompts.
Handling Click Tracking
To ensure accurate monetization and analytics, you must track user clicks on sponsored messages.1
Receive the Token
The sponsored prompts endpoint (for both openers and follow-ups) returns a unique
token along with the sponsored question. Store this token.2
Detect User Interaction
When a user clicks or taps on the displayed sponsored question.
3
Send Click Confirmation
Immediately send a POST request to the
/api/v1/prompt/click/ endpoint. Include the token (received in Step 1) in the JSON body of your request.4
Receive Reward Confirmation
A successful POST request to the click tracking endpoint will record the click and associate the reward.
Best Practices
1. Use Metadata for Better Targeting
2. Control Ad Frequency (Only for follow-up)
UseadFrequencyLimit and conversationOffset to prevent ad fatigue: