Custom events
Count your own actions, like newsletter sign-ups or quiz completions, per test version.
ab.one tracks orders, add-to-carts and page views on its own. Custom events let you count anything else per version: a newsletter sign-up, a filled-in contact form, a finished product quiz, a click on a size guide. They're useful as a second signal next to your goal, for example "the variant sells the same but gets twice the sign-ups".
Custom events don't decide the winner. The goal does.
1. Define the event
Open the test's settings
On the test's page, go to the Settings tab and find Custom events.
Add an event
Click New custom event. Under Event name, enter a short name, for example
newsletter_signup.Allow extra details (optional)
Under Allowed body parameters, list the extra fields ab.one should keep with each event, for example
source. Anything else you send is ignored, so no personal data ends up in ab.one by accident.
2. Send the event
Whoever looks after your store's code sends a POST request when the action happens. The Custom events section shows the address and your store's public key, and a ready-made example:
curl -X POST https://app.ab.one/api/v1/events \
-H "Content-Type: application/json" \
-d '{
"key": "pk_live_…",
"test": "TEST_ID",
"event": "newsletter_signup",
"variant": "b",
"visitorId": "VISITOR_ID",
"properties": { "source": "footer" }
}'
| Field | Required | What to send |
|---|---|---|
key | yes | Your store's public key, from the Custom events section. It's meant to be public and can only send events. |
test | yes | The test's ID. |
event | yes | The event name you defined. |
variant | no | Which version the visitor saw: control, b, c … |
visitorId | no | The ab.one visitor ID, so the event shows up in that visitor's timeline. |
properties | no | Extra details. Only the allowed body parameters are kept. |
ab.one answers with status 202 when it accepted the event.
3. See the results
The test's Custom events tab shows the total for each event, by variant, by device, by country and over time.
If you haven't defined an event yet, the tab says "No custom events defined" and links to the settings.
More detail for developers: Custom events API.