PostHog
PostHog Cloud (US or EU) or your own PostHog host.
Amplitude
Amplitude in the US or EU data center.
How a conversation goes out
- A visitor chats with your agent. Waniwani records each message, tool call and lead as an event, as it always does.
- When the conversation has been quiet for 15 minutes, Waniwani sends its events to your tool. A new message during those 15 minutes starts the wait again.
- If the visitor comes back later in the same conversation, only the new events go out, in a later send.
- When the conversation analysis is done, Waniwani sends a
waniwani conversation analyzedevent.
What your tool receives
Every event name starts withwaniwani followed by the Waniwani event name, so you can find them all at once. You get every event of the conversation, for example:
Internal records that only matter to Waniwani, like model and token usage, never go out.
Each event carries these properties:
waniwani conversation ended adds duration_seconds, event_count and tool_call_count. A conversation that starts again after it went out gets a second conversation ended with the new totals.
waniwani conversation analyzed adds the labels from the conversation analysis. Each one is a fixed value, so you can group and filter on it in funnels and charts:
A label the analysis could not decide is sent as empty. The analysis event needs conversation analysis to be on for your organization. Ask the Waniwani team if you don’t see it.
Link the chat to your visitors
A drain puts chat events on the right person only when the chat knows who the visitor is in your tool. You give the chat that ID with itsvisitorId option: the PostHog distinct ID, or the Amplitude device ID. Each tool’s page shows the exact line to add, and the setup checks that it works.
Without that ID:
- PostHog still gets the events, on an anonymous visitor that creates no person. They count in your totals but can’t join a funnel with your page views.
- Amplitude gets nothing for that conversation, because every new ID would become a new Amplitude user on your bill. The conversation shows as Skipped in Waniwani.
Set up a drain
You need to be an admin of your Waniwani organization.1
Open the drain
In the Waniwani dashboard, go to Settings → Connectors. Under Drains, pick your tool.
2
Connect your project
Paste your project’s API key and pick its region. Waniwani sends one
waniwani connected event to check the key, and tells you right away if the tool refuses it.3
Link the chat
Copy the line shown for your site (React or script tag) and give it to whoever runs your website. When a chat with the right ID comes in, the step turns green. You can skip it and come back later.
4
Send a test conversation
Send one message in your chat, then click Send test conversation. Waniwani sends your newest conversation right away instead of waiting 15 minutes, and lists what went out.
Settings
After setup, the drain page shows what went out in the last 7 days, the most recent conversations, and its settings.Environments
By default every environment of your organization drains. You can pick only some, for example Production, so tests in Staging stay out of your analytics.Message text
Off by default. Your tool then gets event names and labels, with no message content. When you turn it on, user messages and agent replies carry their text inmessage_text, after Waniwani’s PII redaction for your organization. A message whose redaction failed never sends its text.
Test the drain
Send test conversation sends your newest conversation right away, with the same result list as in setup.When something goes wrong
If your tool is down, Waniwani tries the send again a few times. A conversation that still can’t go out shows under Conversations not sent, and Send again queues them once your tool is back. If your tool refuses the key (it was revoked, or you rotated it), the drain page says so and stops sending. Conversations from that time wait in the not-sent list. Paste the new key and send them again.Limits
- Conversations go out about 15 minutes after they stop, not live.
- A drain sends conversations from the moment you connect it. Conversations from before that don’t go out.
- One drain per tool for each organization. PostHog and Amplitude can run at the same time.