Testing an ad SDK integration before launch catches the bugs that cost you revenue in week one: ads that never render, events that never fire, and a matcher that serves a shopping ad in a therapy chatbot. This guide walks through the exact checks to run before you ship the Elo SDK to production.
- How to test ad SDK integration before launch starts with a staging build that mirrors your production LLM stack exactly.
- Elo's SDK logs every ad request and impression event, so fill rate and latency are verifiable before real users see a card.
- Run at least 20 conversation turns across 3 topic categories to confirm the matcher returns contextually relevant ads.
- Ship only after revenue events post to the dashboard with correct CPM/CPC attribution. Verdict: staging test, then canary launch.
Why this matters
An ad SDK that fails silently is worse than one that fails loudly. If init calls throw errors, you'll see it in your logs immediately. If ad requests succeed but revenue events never attribute, you can run for weeks at zero RPM and not notice until someone asks why the dashboard is flat.
AI chat apps have a specific failure mode banners never had: the ad has to match the conversation, not just the page. A card that recommends running shoes in a mental-health support thread isn't a rendering bug, it's a matcher bug, and it only shows up when you test with real conversational context instead of a static test page.
Testing before launch in 2026 also matters because most AI chat products ship weekly. A broken integration that goes unnoticed for one release cycle can mean a month of lost ad revenue by the time someone checks the numbers.
What you'll need
- A staging or sandbox environment that mirrors your production LLM stack (OpenAI, Anthropic, or a custom model)
- The Elo SDK installed with your test API key, not your production key
- Access to your app's event logs or console output
- A test account or user flag so test traffic doesn't mix with real users
- 20-30 minutes to run through a representative set of conversations
- A view of the Elo dashboard to confirm events are posting
If you haven't installed the SDK yet, the setup steps live in how to launch an ad-supported AI chatbot and, for Next.js specifically, in how to integrate an ad SDK into a Next.js chatbot.
The steps
1. Verify the SDK initializes without errors
Confirm the SDK loads and authenticates before you test anything downstream. A failed init call means nothing else in this list will produce real data.
Check your console or server logs for a successful handshake response from Elo on app start. Test this in both a cold start and a warm reload, since some frameworks cache the SDK instance and mask init failures on subsequent loads.
Common mistake: using a production API key in staging. It works, but it pollutes your live dashboard with test events and makes it hard to trust real numbers later.
2. Confirm ad requests fire at the right point in the conversation
An ad request should fire based on your configured trigger, not on every single message. Trigger it, then check the request log for a timestamp and a payload that includes conversation context.
Run 5-10 test conversations and count how many actually generate a request. If your trigger is set to fire once every 3-4 turns, you should see request volume scale roughly with that ratio, not with total message count.
Common mistake: testing with a single one-line prompt. Ad triggers built around conversational context often need a few turns of real back-and-forth before the matcher has enough signal to fire.
3. Check that ads render as native cards, not raw JSON
The SDK returns structured data; your UI has to render it as a card, not dump the response object into the chat. Pull up the rendered output and confirm it looks like a native ad card with an image, headline, and CTA, not a debug blob.
Test on both desktop and mobile viewports. Card layouts that look fine at 1200px wide sometimes break at 375px, especially if the ad copy runs long.
Common mistake: shipping the default card style without checking it against your app's actual chat bubble width. A card that overflows the chat container looks broken even when the data is correct.
4. Test contextual relevance across multiple topic categories
Run conversations in at least 3 distinct topic areas: something transactional ("where should I buy running shoes"), something informational ("explain compound interest"), and something in your app's core use case. Confirm the ads returned in each thread actually relate to the topic.
If you're building on a RAG pipeline or a niche vertical assistant, this step matters more than any other, because generic test prompts won't expose matcher issues that show up with domain-specific language. Details on how the matcher reads conversation context are in how to match ads to conversation context in an LLM app.
Common mistake: testing only with prompts your team wrote. Real users phrase things messier and less coherently than internal test scripts, and that's exactly where matchers misfire.
5. Confirm impression and click events attribute correctly
Every time a card renders and gets clicked, an event should post to the Elo dashboard with the correct CPM or CPC attribution. Trigger 10 impressions and 3-5 clicks manually, then check the dashboard within a few minutes.
If events show up with a delay longer than a few minutes, or don't show up at all, revenue tracking is broken even if the ad itself renders fine to the user. This is the single most common integration bug that goes undetected until a monthly revenue review.
Common mistake: confusing "ad rendered" with "event fired." They're separate calls in the SDK, and a UI bug can break the second without touching the first.
6. Run an A/B test in staging before you run one in production
If you plan to test ad frequency, placement, or copy variants after launch, confirm the split logic works correctly in staging first. Force both variants manually and check that each user consistently sees one variant, not a random mix mid-session.
The mechanics of setting this up are covered in how to A/B test conversational ads in a chat app. Getting the split logic wrong in staging is cheap; finding out in production after a week of skewed data is not.
Common mistake: running the A/B test with too few staging sessions to trust the split ratio. Ten sessions won't tell you if a 50/50 split is actually 50/50.
7. Load-test for latency under real traffic patterns
Ad requests shouldn't add noticeable lag to a chat response. Time the round trip from trigger to rendered card across 20+ requests and check the distribution, not just the average.
A median of 200ms with a few outliers at 2 seconds is a different problem than a consistent 800ms across the board. The first is a network blip; the second is a configuration issue worth fixing before launch.
Keep ads brand-safe before launch
Check filtering rules and category blocks before your first canary rollout.
Troubleshooting
- Ads never render. Check the API key is scoped correctly and that the trigger condition in your config actually matches your test conversation flow.
- Ads render but look wrong on mobile. Inspect the card container's max-width setting; most rendering bugs are CSS overflow, not SDK data issues.
- Events fire but revenue shows zero. Confirm your test account isn't flagged as excluded traffic in the dashboard settings — test users are sometimes filtered out by design.
- Ads are contextually off-topic. Re-check step 4 with longer, messier conversation threads; short test prompts don't give the matcher enough signal.
- Latency spikes under load. Isolate whether the delay is the ad request or your own LLM response time; run the ad request in isolation to confirm.
- Dashboard data lags by hours, not minutes. This is usually a batching setting on the reporting pipeline, not a broken integration — check expected refresh intervals before assuming failure.
Tools and resources
- Elo SDK documentation and dashboard for event verification
- How to launch an ad-supported AI chatbot for the initial setup sequence
- How to measure ad revenue per user in a chatbot for the metrics to watch once you're live
- Your framework's console/network inspector for request-level debugging
- A staging environment flagged separately from production traffic
What to do next
Once every step above passes in staging, launch to a small percentage of real traffic first rather than 100% of users. Watch the dashboard for the first 24-48 hours in 2026 launch cycles before scaling to full traffic — that window catches the edge cases staging testing misses, like ad frequency under real usage volume or matcher behavior across topics you didn't think to test.
FAQ
How long does it take to test an ad SDK integration before launch?
A full test pass through init, request, render, matching, and event attribution takes 20-30 minutes with the Elo SDK. Add another hour if you're also validating A/B split logic or load testing latency.
Do I need production traffic to test ad SDK integration?
No. Staging traffic with a test API key and manually triggered conversations covers every check that matters before launch. Production traffic is for confirming behavior at scale after the initial test pass.
What's the most common ad SDK bug found before launch?
Impression events that render correctly but fail to post revenue attribution to the dashboard. The ad looks fine to the user while the integration silently loses revenue data.
How many test conversations are enough before launch?
Run at least 20 conversations across 3 distinct topic categories. Fewer than that won't expose contextual matching issues that only appear with varied, messier real-world phrasing.
Should I test ad latency separately from LLM response latency?
Yes. Isolate the ad request timing from your model's response time to know whether a slow chat experience is the ad SDK or your own LLM pipeline.
Can I test contextual ad matching without real user data?
Yes, using realistic test conversations across your app's core topic categories. The matcher reads conversation content, not user identity, so scripted test threads with natural phrasing work well.
What should show up on the Elo dashboard during staging tests?
Ad requests, impressions, and clicks should post within minutes of triggering them manually in staging. If nothing appears after 10 minutes, the integration has an attribution issue, not a delay.
Is it safe to test with a production API key?
It works but it's not recommended. Test events mix into your live revenue dashboard and make it harder to trust real performance numbers after launch.
One last thing
The bug that costs the most money is also the quietest one: an ad that renders perfectly, gets clicked, and never posts a revenue event. It looks like a working integration on the surface, which is exactly why step 5 above — checking the dashboard, not just the UI — is the one step teams skip and regret.



