In this article, we’ll learn about the concept of Webhooks in VWO, its advantages, and how you can enable it in VWO.
To better understand the concept of Webhooks in VWO FullStack, let's first learn about the settings file.
Whenever you create a FullStack campaign in VWO, a settings file corresponding to your campaign configurations is stored on your server. If any campaign setting(s) are modified via the VWO App, the settings file stored at your server needs to be updated. This ensures that your campaigns are always running on the latest configurations.
Let's look at the different options that VWO offers to detect the change and update the settings file.
One way to detect the change in the settings file is by polling the VWO servers frequently, and when detected, update the settings file with it. This increases the load on your server as you need to poll the VWO Servers at a regular interval, say every ten minutes.
Another way to detect the change in the settings file is by using the Webhooks. Webhooks in VWO enables you to subscribe to changes. Anytime there is a change in the FullStack campaign settings, VWO sends an HTTP POST call with a payload to the configured URL. Therefore, you know when to fetch the settings file. It helps you to keep the most up-to-date version of the settings file.
1. This feature is only available in VWO FullStack.
2. As of now, we have rolled out this feature in Node.js SDK. We will
soon be rolling this out in other SDKs as well.
With Webhooks in place, you don't have to worry whether or not you are using the updated settings file. VWO keeps you up-to-date.
For example, as soon the traffic allocation percentage of a variation is changed from the app, VWO sends an HTTP POST call with a payload to notify about a change in the campaign settings.
To get notified about the change in the settings file, all you need to do is-enable the Webhook setting from the Campaign Settings UI and specify the URL where you wish to receive the change event notification. To know how to do this, refer to Enabling Webhooks in VWO.
Advantages of Using Webhooks in VWO
- Eliminates the need to frequently fetch the latest campaign settings file that reduces the load on your servers.
- Eliminates the possibility of using the old campaign settings file if not fetched in short intervals.
Enabling Webhooks in VWO
If you wish to get notified whenever there is a change in campaign settings, enable the Webhooks feature.
- Login to your VWO account.
- Go to Settings > CAMPAIGN SETTINGS.
- Scroll down to the Webhooks section and select Enable Webhooks.
- In the Enter the URL field, enter the URL where you wish to receive the change event notification.
- To finalize your settings, click SAVE.
Below is the payload format used by VWO.
NOTE: getAndUpdateSettingsFile is only available in Node.js SDK
from v1.10+ onwards