Webhooks

Teams Included on the Teams plan. Not available on the Lite version. Upgrade →

Send an HTTP POST when a test is complete

You can set up webhooks sitewide, for every test, or just for individual tests.

If you have an individual test webhook and a global webhook defined, the single test webhook will be sent and the global will not.

Webhook for all tests

In your WP Admin, go to AB Split Test > Settings > Integrations and find Webhooks

Enter the URL that you want to send to data to.

The Webhooks section of AB Split Test settings: a Full URL field, with the note that a completed test sends an HTTP POST containing the test ID, name and statistics to an endpoint of your choice.

 

Webhook for a single test

Go to AB Split Test > All Tests and open your test

Open the Webhooks section near the bottom of the test settings

Add your webhook URL there.

The URL you save here URL will receive an HTTP post when this test completes.

The Webhooks section of a single test in the AB Split Test editor, with a webhook URL entered and a sample of the JSON sent when the test completes.

Data

The webhook is a JSON POST sent when the test completes. It carries the event, the test’s ID and name, the winning variation (its key, its label and its winning percentage) and the raw observations: visits and conversions for every variation, broken down by device size.

{
  "event": "complete",
  "testId": 4182,
  "testName": "Northside Dental - booking page",
  "winningVariation": "variation2",
  "winningVariationLabel": "Variation 2",
  "winnerPercentage": 95,
  "observations": {
    "variation1": {
      "visit": 1500,
      "conversion": 120,
      "device_size": { "desktop": { "visit": 700, "conversion": 58 }, "tablet": { … }, "mobile": { … } }
    },
    "variation2": { "visit": 1600, "conversion": 180, "device_size": { … } }
  }
}

If the request fails, the site’s admin email receives the error, so a broken endpoint does not go unnoticed.

Leave a Comment

You must be logged in to post a comment.