- Webhook-based integration: This updates the project settings asynchronously based on event triggers from PageSense.
- Polling-based integration: This updates the project settings synchronously at a predefined time interval using a dedicated polling thread in SDK.
Webhook
When users make updates to a FullStack A/B experiment in PageSense—such as editing variations, changing targeting conditions, or modifying goals—they usually pause the experiment, apply the required changes, and then relaunch it by clicking the Launch button.
If a webhook has been configured in the Environment Settings of your PageSense project, PageSense will automatically trigger a webhook call to the specified webhook endpoint whenever the experiment is relaunched.
Your system should be prepared to receive the webhook call from PageSense and trigger the getAndUpdateProjectSettings API immediately after receiving the webhook, so the API updates the latest project setting details in the without any delay.
Webhook Retry
If the initial webhook call fails due to network issues or server downtime, PageSense will automatically retry the webhook call every 30 seconds for up to 15 minutes. If the call is not successfully processed within that time window, retries will stop. However, if additional updates are made and the experiment is relaunched, the webhook call will be retried again.
Polling
If webhook integration is not feasible in your environment, you can use the SDK’s polling mechanism to keep the project setting details up to date. When polling is enabled, the SDK automatically calls the getAndUpdateProjectSettings API at regular intervals (configured by you) to check for any updates in PageSense.
A background thread in the SDK is started for the polling based on the configured polling interval. At each interval, it calls the getAndUpdateProjectSettings API to check for updates in the PageSense project settings. If any changes are detected, the API updates the internal state of the SDK with the latest project setting details. If there are no changes, the SDK runs with the existing project settings until the next polling cycle.
Polling is a reliable fallback if webhook support is unavailable or impractical in your server architecture.
API Usage
- pageSenseClient.getAndUpdateProjectSettings("accountName", "sdkKey", "projectName");
Parameter details:
Parameter | Type | Required | Description |
accountName | String | Yes | The unique identifier of your PageSense account. |
sdkKey | String | Yes | The secure key for the environment, available under the Environment section of the PageSense application. |
projectName | String | Yes | The name of the project as defined in your PageSense account. |
Example code
- pageSenseClient.getAndUpdateProjectSettings("ZylkerUser1", "xyz123abdscd", "ZylkerFullStackProject");
We hope this documentation helps make the process easy for you. Please feel free to reach out to us anytime by dropping an email to
support@zohopagesense.com if you need more explanation or have any questions.