Creation at: 2024-12-22 | Last modified at: 2024-12-31 | 6 min read
Are you looking for a simple and effective way to gather lead information during online chats? dmflow might be your best choice. This article will detail how to set up and use dmflow to solve your problems in collecting leads.
dmflow’s advantages lie not only in its powerful features but also in its flexibility and integration:
After setting up the form, you have two ways to use it:
Test Your Form:
To ensure the form works correctly, it’s recommended to test it. If you have previously entered values, use your browser’s incognito mode to open a new window for testing to avoid data duplication. Please note, do not repeatedly open too many new windows in a short time for testing, as the system may temporarily block your account for 12 hours if it detects repeated visitor creation.
Advanced Use: Using sys_user for Branching
If your process requires users to fill out a form before proceeding, you can use the sys_user
variable for branching conditions. This can effectively filter users, ensuring only those who have filled out the form can proceed. For example, you can set a condition:
Field Descriptions:
birthday
, the birthday information entered by the user will be stored in the database field named birthday
.Information Collected by dmflow Can Be Used For:
If you need to set up a lead webhook, go to the publish page to configure it.
Set the events to bot:lead
with the following webhook format:
{
"events": [
{
"resource": "bot:lead",
"action": "add",
"payload": {
"email": "",
"username": "",
"phone": "",
"customs": {
"key": "value"
},
"timezone": "+08:00"
}
}
]
}
Explanation:
resource
: Set to "bot:lead"
, indicating this webhook is for leads generated by the bot.action
: Set to "add"
, indicating this webhook is triggered when new lead data is added.payload
: Contains lead information:
email
: The customer’s email address.username
: The customer’s username.phone
: The customer’s phone number.customs
: Used to store custom field data. key
represents the key you set in the form, and value
is the value entered by the user. For example, if your form has a “Birthday” field with the key birthday
, and the user enters 1990-01-01
, then customs
will be {"birthday": "1990-01-01"}
.Example Usage:
Suppose a user fills out the following information in the form:
[email protected]
TestUser
0912345678
1995-03-15
(field key is birthday
)Then the webhook payload will be:
{
"events": [
{
"resource": "bot:lead",
"action": "add",
"payload": {
"email": "[email protected]",
"username": "TestUser",
"phone": "0912345678",
"customs": {
"birthday": "1995-03-15"
},
"timezone": "+08:00"
}
}
]
}
Key Points:
customs
field allows you to flexibly send any custom field data you set in the form.Using the webhook will send the events to the endpoint you specify.
To use dmflow’s built-in trigger (Webhook), go to the form settings page to enable it. Currently, you can only enable one trigger regardless of how many form fields you have, and this feature is not yet available for the lite version users.
Webhook Usage Limits:
Default Webhook Format:
After enabling the Webhook, the default format obtained is as follows:
{
"start": {
"events": [
{
"resource": "bot:lead",
"action": "add",
"payload": {
"email": "",
"username": "",
"phone": "",
"customs": {
"key": "value"
},
"timezone": "+08:00"
}
}
]
}
}
Payload as an Array:
If the payload format obtained is an array, the format is as follows:
{
"start": {
"data": []
}
}
This indicates that the data
field is an empty array, and you need to fill in the data in this array according to your actual needs.
Setup and Usage:
After setting up the Webhook, you can start using the trigger. You can enable authority matching to enhance security.
Webhook Trigger Timing:
This Webhook will be triggered in the following situations:
Field Descriptions:
resource
: Set to "bot:lead"
, indicating this Webhook is for leads generated by the bot.action
: Set to "add"
, indicating this Webhook is triggered when new lead data is added.payload
: Contains lead information:
email
: The customer’s email address.username
: The customer’s username.phone
: The customer’s phone number.customs
: Used to store custom field data. key
represents the key you set in the form, and value
is the value entered by the user.Security Considerations:
It is recommended to enable authority matching. If other products can enable signature verification for the payload, verify the source of the Webhook request to ensure only legitimate requests can trigger subsequent actions, enhancing system security.