Attracting new customers to Viber bot
Why we don’t send a message to Viber directly with a phone number?
Communication with the user directly by phone number is technically limited by Viber.
Viber Bot allows you to communicate with the client in online chat. Once the user goes into the chat with the bot, Viber transmits its chat ID and you can start communicating and sending messages. Therefore, for an invitation to bot you can use direct links (deep links), which are sent to sms, e-mail or as a QR code.
How to identify a user who came to bot via a direct link from the message?
Make deep link unique for each user by adding extra data to context parameter. As soon as the user follows the link, the context parameter will be received and it will be possible to determine which user accepted the invitation and save the phone number and chat ID for further communication in Bot.
Processes for attracting new customers to bot work only as an addition to Bot platform.
How to use processes
Click Use this process and folder with processes will be copied into your environment. You need to move this copy to the folder "Bot".
Objects of folder “Attracting new customers”:
Phone numbers for sending invitations - state diagram for downloading phone numbers for bulk SMS
Start sending - process that triggers bulk SMS for new users via phone number
Invitation with a Viber deep link - process to send a message with a deep link
API Send SMS (eSputnik) - process for sending sms (could be replaced with any other service)
Config - state diagram with identifiers of processes for bot platform (for interaction between processes)
Сommand Verify - process for step-by-step verification of the user (request and confirmation of the phone number)
Invited users states - a state diagram that captures all states from sending an invitation to verifying
Invited users dashboard - dashboard displaying statistics on attracting users to your bot
Interaction with processes Bot platform
To interact with copied processes, it is necessary to make a number of changes:
- In the state diagram Config, add a new task:
As reference (
REF) specify “config”, parameter value - ID of Bot Platform processes:
main_logic- MAIN logic
send_messages- Send messages
state_diagram- State diagram
In state diagram Commands processes add task:
As reference (
REF) specify value “verify”, parameter
proc - process’ ID Command Verify from copied folder.
- Add to your process Receiver & Route message processing of a new event conversation_started. This event enters the process when the user follows deep link from the message.
In a node with Condition logic, you need to add a condition:
event == converation_started
If this condition is true, then the task will go to a new node “Event parameters”, and where from parameters received from Viber, standard parameters of the platform bot are formed. After that and then to the MAIN logic process.
- In MAIN logic add logic for checking parameter
contextvalue. From process Receiver & Route message with event
Add a node with the logic Condition to check the value of the context parameter. If empty, the logic will be the same as for the "start" command.
If we get a non-empty
context, then the task will go to the new node with Set Parameter logic "Set verify copy_proc_id" to get the required process ID (see paragraph 2).
- In Send messages process, add the ability to transfer the finished keyboard object.
- Finalize process Viber - Send messages for sending button with parameter
"ActionType":"share-phone"(by pressing the phone number to which Viber is registered). This functionality is supported in API Viber version 3 and higher. You need to add in node with logic API Call "Send text message & keyboard" parameter
How to implement SMS sending for attracting customers to Viber bot
- Connect your process to send messages or enter your account information in the API Send SMS process (eSputnik).
- You need to specify the URI of your public / bot account Viber to form a deep link. You can find it in your account information:
In the process Invitation with a Viber deep link in the node with the Set Parameter logic "URI and context for link" for the
chatURI parameter, insert the copied value.
Add to state diagram Phone numbers for sending invitations phone numbers.
In process Start sending add empty task to start sending. Messages will be sending in rotation.
The results of the sending efficiency show real-time dashboard Invited users dashboard. The user goes from state to state:
Sent invitations - message with invitation was sent
Failed invitation - failed to send invitation message
Accepted invitations (used deep link) - go to the link from the invitation (opened bot)
Verified (after invitation) - verification and phone number from invitation are passed
Verified (without invitation) - passed verification with another phone number (for example, the second user number)
In the state diagram Invited users states, after successful verification, the user's Viber chat ID is added. This allows in the future, use phone number, to send messages directly to the bot.