One of the most effective ways to attract customers to messengers and social networks is through the use of invitation links.
For customer convenience, use link shortening services.
To send messages via API, you can add unique customer information at the end of the invitation link. This information will be passed to the bot using a special keyword.
Example invitation link for a Telegram bot: https://t.me/Test_Mailing_Bot. This link lacks personalization, so we won't be able to distinguish one customer from another. However, if a unique keyword is added to it for each customer, the bot can identify the user and provide personalized content.
The link may look like this: https://t.me/Test_Mailing_Bot?start=1234567. When clicking on this link, the bot can receive information and identify the user. You can click on these links and see the bot's reaction for yourself. You can also try changing the information in the link — the bot will display it to you.
Adding keywords and unique customer information to the link allows the chatbot to automatically recognize the user and obtain necessary data about them without additional questions.
Each messenger and social network uses its own unique keyword:
These keywords are added at the end of the link. You can use numbers and Latin letters.
For Facebook, information transfer only works with links in the format
http://m.me/PAGE-NAME?ref=DATA, wherePAGE-NAMEis the name of the page where the bot is located, andDATAis the data to be transferred.
To work with the information passed from the link, use the variable clientExternalId — this is where the information will be recorded after the link's keyword. This variable is used for all social networks and messengers, regardless of whether the client came via a link in Telegram or, for example, Facebook.
The system automatically populates this variable with the value from the link. You can output any variable, including clientExternalId, in a report or use it in Condition and Server Request blocks.
You can transmit customer identifiers in the link. If you need a lot of information about the customer, such as the product they ordered, its price, and quantity, the Server Request block and integration with CRM will help:
clientExternalId variable.Use the invite link to pass the values of the customer's external ID, phone, email, and bot script variables. To do this, perform the following steps:
Generate json. Use the following abbreviations to form the query:
p - phone.e - email.eId - externalId.v - variables.Encode json in Base64URL.
The maximum length of the resulting Base64URL-encoded string is 64 characters. If the limit is exceeded, the data will not be transmitted.
Paste the encoded json into a link to the bot. The link will look like this: https://t.me/<bot_name>?start=<Base64URL-encoded JSON>, where:
<bot_name> - username of your Telegram bot (for example: MyCoolBot).start - parameter containing Base64URL-encoded JSON (for example: eyJlIjoiZW1haWxAZ21haWwuY29tIn0).The value of the variable will be automatically passed to the script.
Examples of value passing:
To pass the value email@gmail.com to the email variable, perform the following steps:
{"e":"email@gmail.com"}.eyJlIjoiZW1haWxAZ21haWwuY29tIn0.https://t.me/bot_name?start=eyJlIjoiZW1haWxAZ21haWwuY29tIn0.To pass the value 79000000000 to the phone variable, perform the following steps:
{"p":"79000000000"}.eyJwIjoiNzkwMDAwMDAwMDAifQ.https://t.me/bot_name?start=eyJwIjoiNzkwMDAwMDAwMDAifQ.To pass the value of externalId to externalId, follow these steps:
{"eId":"externalId"}.eyJlSWQiOiJleHRlcm5hbElkIn0.https://t.me/bot_name?start=eyJlSWQiOiJleHRlcm5hbElkIn0.To pass the value Moscow to the city variable, perform the following steps:
{"v":{"city":"Moscow"}}.eyJ2Ijp7ImNpdHkiOiJNb3Njb3cifX0.https://t.me/bot_name?start=eyJ2Ijp7ImNpdHkiOiJNb3Njb3cifX0.To avoid exceeding the maximum length of 64 characters of the resulting base64URL string, use the following tips:
{“v”:{“stage_name”:“1.First stage”}} use {“v”:{“stage”:“1”}}.firstName: John, lastName: Smith, age: 23, use cl_data:John Smith 23, and in the script split into 3 variables via BPL.