Deeplink is supposed to pass parameters in the link. You can track the source of bot traffic or set parameters for users who clicked on the link. In other words, Deeplink is a UTM tag for a chatbot.
It works in Telegram, Viber, VK and Facebook.
To create Deeplink, go to Settings → Events and click Add Event. Enter the Name of eventand select Type — Deeplink.
To delete event, click on the Delete button.
Deeplink with text
It is used to create a link that leads to a specific screen. For example, you generated a vasya Deeplink to count the clients that your partner Vasily brought. To do this, you send all users to the screen that records the session.
- Add and name Deeplink.
- In Properties, specify Type — Text and its Value — Latin text (parameter) which will be specified in the link and will be written to the deeplink variable.
- In Action, specify Type — select whether any Screen or Text will be sent to the user.
- In the Links, copy the links you need with the value added.
Deeplink with a regular expression
It is used to create a link that leads to a specific screen. It can be used to track user traffic from different advertising campaigns by the parameter at the end of the link.
- Add and name Deeplink.
- In Properties, specify Type — Regular expression and its Value — the required regular expression. Specify the Variable name — an arbitrary variable where the reference parameter and Variable type — Array or String will be written. If necessary, set regular expression flags.
- In Action, specify Type — select whether any Screen or Text will be sent to the user after clicking on the link.
- Click the save button to create a link. In Links, you need to copy it and add a value suitable for the regular expression after = sign at the end of the link. The expression will be written to the variable.
A variable with a certain value in it will immediately be assigned to a user who clicks on such a link. The constructor components (Fork, Alert, etc.) can immediately start working with this variable. The parameter passed to the bot is displayed in Users.
For Deeplink with regular expressions, you can choose Type of variable: Array or String. The array will be useful when you need to get not only the value of Deeplink, but also its individual parts. The first element will have the full value of Deeplink, the rest elements will have the group value. For example, regular expression: triforce_of_ (.+?)$ and Deeplink triforce_of_wisdom has such an array: [triforce_of_wisdom, wisdom]. In this case, String type writes to variable string: triforce_of_wisdom.
A regular expression .* skips any value (Latin text and numbers). If you use this regular expression, you will not be able to create more than 1 Deeplink. If you need several Deeplinks, create a unique regular expression for each Event.
Deeplink in Viber
Due to the peculiarities of Viber platform (the bot is launched only after the user's reaction), to receive the screen again, the user needs to write to the bot after clicking on Deeplink. To avoid this, you need to make another Deeplink Event separately for Viber, which will direct it to a screen specially created for Viber. On this screen, you need to place "Start" button with a navigation to the desired screen.
Deeplink for non-standard situations
Sometimes we need to get, for example, the user's email via Deeplink, but the URL restrictions do not allow us to do this. In this case Base64 comes to the rescue.
In general, the work with Deeplink does not change. All you need after receiving a Deeplink is to substitute base64- at the end.
Let's take an example.
1. First create a screen in the builder, which will be sent when a Deeplink is triggered.
2. Create and setup a Deeplink event.
3. Copy the resulting Deeplink into the browser's search bar and add base64- to the received link to indicate to the bot that the data are transmitted in base64 format.
4. Encode the necessary data. You can use a third-party service, for example www.base64encode.org.
5. Insert the resulting base64 format string to the end of Deeplink (after base64-).
6. Follow the link we created to test the received Deeplink.
After clicking on the link, we receive base64, decrypte it and record the final value.
In user variables, you can also see the decrypted email that was written to the relevant variable after Deeplink worked.
The final link must not exceed 64 characters — Telegram and other platforms may refuse to work with large links. Use the Latin alphabet and special characters, otherwise base64 can encode text with invalid characters for the URL, and then the link will not work.