A/B Testing API
Run experiments and split tests to optimize conversions
Base URL: https://api.wemasy.nl/api
ⓘ The token stays in this browser tab only (sessionStorage) and is sent to the WEMASY API only. Don't use production tokens on shared computers.
A/B testing
Every test, with its results so far and its languages, and the tests started this month against the plan's limit
POST
/services/a-b-testing/v1/a-b-testing/tests/all
Auth
POST
/services/a-b-testing/v1/a-b-testing/tests/get
Auth
A new test, as a draft. Without versions: the original and one copy, half each; without a goal: a form sent
POST
/services/a-b-testing/v1/a-b-testing/tests/create
Auth
Name, page, versions, goal. While it runs only the name: anything else would mix results
POST
/services/a-b-testing/v1/a-b-testing/tests/edit
Auth
POST
/services/a-b-testing/v1/a-b-testing/tests/delete
Auth
Starts the test; a stopped one starts a new run that counts from zero
POST
/services/a-b-testing/v1/a-b-testing/tests/start
Auth
POST
/services/a-b-testing/v1/a-b-testing/tests/stop
Auth
The winner: the test stops and every visitor gets this version from now on
POST
/services/a-b-testing/v1/a-b-testing/tests/winner
Auth
The test's texts per language (#1056): ab-testing/{slug}/i18n/{lang}.json, the only place they live. A visitor gets their language's value of a change, else the project's language's (fallback_language), else the one in test.json
POST
/services/a-b-testing/v1/a-b-testing/tests/texts/get
Auth
One language's texts, written whole and committed: versions {key: [{selector, set, value}]}, each the value of that version's change with the same selector and set. Not while the test runs (the results would mix)
POST
/services/a-b-testing/v1/a-b-testing/tests/texts/save
Auth
Removes one language: its visitors get the project's language again. Not while the test runs
POST
/services/a-b-testing/v1/a-b-testing/tests/texts/delete
Auth
The edit link of the visual editor: the test's page on its website with #wm-ab-edit=<token>. The tracking code there opens the editor; the token (signed, 2 hours, not stored) lets it read and save this test only. page: a path on the WEMASY website (default: the test's page), or a full link to a page of another website that may run the tests
POST
/services/a-b-testing/v1/a-b-testing/tests/editor-link
Auth
Which elements selectors find on a page (the AI's page check): for the onboarding's quick starts, the page's main heading and button. page: a path on the WEMASY website, or a full link to a website that may run the tests. Reads the HTML as the server sends it
POST
/services/a-b-testing/v1/a-b-testing/tests/page-check
Auth
The websites that may run the tests (ab-testing/settings.json); [] = any website with the code
POST
/services/a-b-testing/v1/a-b-testing/sites/get
Auth
POST
/services/a-b-testing/v1/a-b-testing/sites/edit
Auth
A/B testing (public)
The tests for a page: running ones with their versions and weights (the visitor's browser picks one and keeps it), and finished ones with a winner (everyone gets the winner, nothing is counted)
POST
/services/a-b-testing/v1/public/tests
Public
`language`: the visitor's (the tracking code's window.wemasy.language: the signed-in user's, data-lang, <html lang>). Each change comes with its value in that language when the test has one (ab-testing/{slug}/i18n/, #1056), else in the project's language, else as in test.json; a test that used such texts says which language (`language`). A language that is not a language code counts as none (never a refusal: the tests run).
A visitor saw a version (exposure) or reached the goal (conversion). Once per visitor and run; a conversion counts for the version the visitor saw, and only after an exposure
POST
/services/a-b-testing/v1/public/event
Public
The visual editor on the website (#wm-ab-edit=<token> in the page's address): the test to edit, the dashboard language and the way back. The token is the login here: signed, short-lived, for this one test
POST
/services/a-b-testing/v1/public/editor/session
Public
The visual editor saves: the versions and the goal, validated and written like the dashboard's edit (the test file, committed). A running test cannot change
POST
/services/a-b-testing/v1/public/editor/save
Public