Through a webhook, you can send various parameters to your server: parameters received from the Web2App onboarding link, AmplitudeId, UserIP, UserAgent, user-entered information during onboarding, or data obtained from another webhook. This article will guide you on how to configure the sending of data to your server by adding them as parameters in a webhook.
How to Transfer Parameters from the Web2App Onboarding Link to a Webhook
If your Web2App onboarding link contains parameters (e.g., attributes of an advertising campaign), you can transfer them to a webhook on your server. For instance, you created a link: https://web.onboarding.online/welcome-to-books-app and added attribution parameters: https://web.onboarding.online/welcome-to-books-app?utm_source=facebook&utm_medium=cpc&utm_campaign=audience_FB&utm_content=Books_App.
To add parameters to a webhook, follow these steps:
Step 1: Intercepting the Parameter
Open the Web2App link editing screen and click "+ADD" in the "Income parameters" section.
You'll see a screen for adding a GET parameter interception.
In the 'Get Parameter Name' field, enter the name of the parameter from your initial link (e.g., utm_source). It must match exactly.
In the 'Income parameter key' field, enter the name of the parameter to be saved for transmission. You can rename the received parameter or leave it unchanged (e.g., utm_source or HELLO).
Specify the 'parameter type' - the data type in the parameter (string or number).
Save the parameter interception by clicking ADD.
Step 2: Adding the Parameter to the Webhook Request
Add and set up the webhook. In the "request parameters" section, click "ADD".
You'll see a screen for adding a parameter to the webhook. Fill in the fields:
Select the interception method - choose "Income parameter" from the dropdown list.
Enter ‘Value’, which must correspond to the name entered in the "Income parameter key" (e.g., HELLO or utm_source).
Enter "Key" — the name of the parameter in the webhook request. For instance, if you write BUY, your webhook will contain the parameter BUY with the value from utm_source.
Save the parameter addition to the webhook by clicking ADD.
To apply the parameter addition to the webhook, click Update.
Example
Example
You added the 'utm_source' parameter as 'HELLO'. Then, you added the parameter to the webhook, specifying 'HELLO' as 'Value' and 'BYE' as 'Key'. The result will be https://yourserver.com/webhook?BYE=facebook.
To apply the parameter addition to the webhook, click Update.
Transferring Amplitude ID, IP, and UserAgent to Webhook
Set up the Web2App link by selecting the required parameters: Amplitude ID, IP, or UserAgent.
Add a webhook and in the "request parameters" section, click "ADD".
A screen will appear for adding a request parameter to the webhook. Fill in the fields:
Select the interception method - choose "Income parameter" from the dropdown list.
The ‘Value’ field value must correspond to the parameter name added in the "Income parameter key": userIp, userAgent, or amplitudeDeviceId.
For convenience, you can copy the name from the Income parameters section.
In the "Key" field, enter the name of the parameter for the webhook. For instance, if you want to transmit UserIp and name the parameter 'USER_IP', enter USER_IP in 'Key' -> the parameter named USER_IP will be sent in the webhook.
Save the parameter addition to the webhook by clicking ADD.
Example
Example
You added 'userIp' as 'Value' and 'USER_IP' as 'Key'. The result: https://yourserver.com/webhook?USER_IP=[received user ip].
Important: To send amplitudeDeviceId, you need to add this analytics system in the project settings on our service - instruction by the link.
How to Transfer User-Entered Data to a Webhook
To transfer data from a specific screen (e.g., the user's entered email address, choices in tables, etc.), follow these steps:
Remember the ScreenID from which you want to send data.
In the Web2App link editing form, add a webhook, in the "request parameters" section, click +ADD.
A screen will appear for adding a parameter to the webhook request. Fill in the fields:
Select the interception method - choose "User data" from the dropdown list.
In the "Value" field, enter the Screen ID you noted earlier.
In the "Key" field, enter the name you want to assign to the parameter in the webhook. For example, if you enter ‘email’, the webhook will add a parameter named = email containing the email entered by the user.
Click the ADD button to add the parameter.
Example
Example
You sent data from screen1 where the user entered an email, using 'email' as 'Key'. The result: https://yourserver.com/webhook?UserEmail=[[email protected]].
How to Transfer Data from One Webhook to Another
You can transfer data from one webhook to another. Follow these instructions:
Step 1: Intercepting the Webhook Response
Set up the webhook type "WaitForResponse". In the "Response parameters" section, click "+ADD".
In the 'Key' field, enter the exact name of the parameter you expect from your server's response.
Choose the data type sent by your server for this parameter (string, int, or double).
Click ADD.
Step 2: Sending the Received Parameter to the Next Webhook
Add another webhook. In the "request parameters" section, click "+ADD".
Select "Hook Response" in the dropdown list for the interception type.
In the "Value" field, enter the exact name of the parameter that comes in the response from the previous webhook.
In the "Key" field, enter the name of the parameter that will be sent in the current webhook request.
Click on the ADD button
Click Update to apply the parameter.
Example
Example
You set up a webhook to intercept 'UserID' and added a second webhook with URL https://yourserver.com/webhook2, specifying 'UserID' as 'Value' and 'UniqueUserID' as 'Key'. The result: https://yourserver.com/webhook2?UniqueUserID=[value from webhook1].