-
Notifications
You must be signed in to change notification settings - Fork 7
Experiment Channels
Experiment Channels allow users to interact with experiments through an external channel like Telegram or WhatsApp. Simply creating the channel should active it and allow forwarded messages to reach the configured experiment (see the section below on specific actions that happens when a channel is created or updated). Extenal channel messages are forwarded to the server on the <your-domain>/channels/<your-channel>
path.
This refers to the chat view in the web UI. Web channels are created automatically for new experiments and hidden from the admin dashboard, since no user interaction is required to maintain these.
Adding a Telegram channel requires an active telegram bot. In the Channel creation form, you'll need to add your bot token in the extra_data
field. Note that this is a JSON field, so the final value of this field should look like
{"bot_token": "your token here"}
When the channel is saved, this token is used to register a webhook at Telegram so that new messages to this bot will be forward to the server.
Adding a WhatsApp channel requires you to have a Twilio account and WhatsApp number. Once you have this, you need to complete these three steps:
You need to add these environment variables for this integration to work:
- TWILIO_ACCOUNT_SID
- TWILIO_AUTH_TOKEN
In the ExperimentChannel creation form, choose the whatsapp
platform and change the value of the extra_data
field to look like
{"number": "+12345678910"}
Go to the Develop
tab in your Twilio account, then go to Messaging
-> Senders
-> WhatsApp Sender
. From here you can configure it to forward messages to your server via webhooks. The final webhook URL should look like
https:///channels/whatsapp/incoming_message
and make sure to configure it as a POST request.
This should conclude the integration.