Tracking Events using Webhooks
You can capture events like Contact Created or Chat Completed on your own webhook url. This is useful when in case you want to capture and log such events in your own system! Alternatively, these events can be easily logged in AmplifyReach Analytics with the help of Markers.
Webhooks are user-defined HTTP callbacks and they are triggered by some event. E.g It can be called on getting a lead information, conversation completed, chat closed etc. Webhooks are always sent as an HTTP POST request to the webhook URLs you’ve configured.
The details of the activity that triggered the webhook are sent as the body of the HTTP request in JSON format. Every webhook will include an event_type property that describes what kind of activity triggered the event.
Webhook events give you access to realtime information about what’s happening in your AmplifyReach account. Instead of asking us for information on a regular basis, we’ll tell you about events!
Configuring Webhooks
Go to AmplifyReach Dashboard > Analytics > Settings > Conversation Configuration > Webhooks.
Click on the ‘NEW WEBHOOK’ button, the new window appear as follows
Please enter following details:
- Name: Name of the webhook
- URL: Webhook URL. This URL must support the post request.
- Event: Type of the events you have to subscribe to.
Event types:
Event Type | Description |
---|---|
Contact Information | When Lead Generation Chatbot captures contact information, this contact information is sent on configured webhook. |
Chat Transcript | When chat gets closed, chat transcript is sent on configured webhook. |
Request format:
When an event occurs, we’ll send an HTTPS POST request to your configured request URL. The JSON payload we send will include two top-level attributes:
- type – the type of event (see Event Types below)
- data – the data associated with the event (a contact, a chat transcript etc)
JSON |
{ “type”: the_event_type, “data”: { … } } |
Example Webhook Data
Contact Information
JSON |
{ “type”: “Contact Information”, “data”: { “name”: “John Carter”, “email”: “john.carter@outlook.com”, “phone”: “+919811123456” } } |
Chat transcript
JSON |
{ “type”: “Chat Transcript”, “data”: { “chat_transcript”: “Chat Transcript” } } |
In this way, whenever a lead is generated, this webhook will log the information in the system.