Use casesUse case
Trial length testing, judged by the revenue that comes weeks later
A trial's result arrives long after the sign-up. Report each payment by customer, count payments over a window long enough to see it, and Zigbongo learns which trial earns more per customer.
What it decides
One decision, made when the account is created, with options you've built and can honour:
- How long: 7, 14 or 30 days, sent as
7d,14dand30d, with the trial you offer today as the default. - On what terms: card up front or not, or a trial against going straight to a paid first month at a price you've set.
Your sign-up page is the flow, the place in your product where Zigbongo chooses, and each new account's sign-up is one session, so a trial test costs one session per new account, however long the trial runs.
The outcome comes weeks later
Activity during the trial tells you little: a longer trial may get more people using the product and fewer of them paying, or the reverse. What you want to know is how much each new customer pays in their first weeks. That money arrives from your billing system, after the trial ends, often in a different process from the one that handled the sign-up.
So report it by customer rather than by session. Send every payment, the first invoice and the renewals after it, with your account id as the customer's id (subjectId). Zigbongo attaches each one to that customer's sign-up session, as long as it falls inside the flow's attribution window, and adds them up. The window runs from the session's first decision, at sign-up.
Set a window longer than the trial
A flow's attribution window is one day unless you change it, which would never see a trial's revenue. Make it cover your longest trial plus the payments you want to count. For a 30-day trial, a 75-day window counts the first invoice and the renewal a month later, with time to spare for late payments:
curl -X PATCH https://zigbongo.com/v1/flows/signup-trial \
-H "Authorization: Bearer $ZIGBONGO_KEY" \
-H "Content-Type: application/json" \
-d '{"objective": {"window": "P75D"}}'
This creates the flow if it doesn't exist yet, so set it before the first sign-up. Get the window wrong in the short direction and the result is biased, not just noisy: if it closes before the 30-day trial's first invoice, the long trial's revenue never counts and the short trial wins whatever it earns.
Wire it up
At sign-up, decide once and store the length with the account. Don't ask again on a later visit: each call is a fresh choice, and the customer should keep the trial they were given.
import { Zigbongo } from "@zigbongo/sdk";
const zb = new Zigbongo({ apiKey: process.env.ZIGBONGO_KEY, baseUrl: "https://zigbongo.com" });
const DAYS = { "7d": 7, "14d": 14, "30d": 30 };
const s = zb.session("signup-trial", String(account.id));
const trial = await s.decide("trial_length", ["7d", "14d", "30d"], "14d", {
inputs: { source: account.signupSource, platform: account.platform, country: account.country },
});
await startTrial(account, { days: DAYS[trial.option] });
Then report each payment from your billing webhook. In PHP, for example:
use Zigbongo\Zigbongo;
$zb = new Zigbongo(apiKey: getenv('ZIGBONGO_KEY'), baseUrl: 'https://zigbongo.com');
// Your billing provider's "invoice paid" event, for every invoice
$zb->outcome($invoice->id, 'signup-trial', $invoice->amountPaid / 100,
subjectId: (string) $invoice->accountId, at: $invoice->paidAt);
The invoice id makes the report idempotent, so a webhook delivered twice is counted once. at dates the payment when it happened, which matters if you send them later from a job. In Node, the same call is zb.outcome({ outcomeId, flowKey, subjectId, value, at }). Outcomes are retried on timeouts and when Zigbongo is busy, and a PHP worker waits through those retries, so report from a queued job rather than in the webhook's own request.
Context worth sending
The sign-up page knows little about a person yet, so use what it has. The traffic source says something about intent: someone who searched for your product may need less time to decide than someone who clicked an ad. Platform and country can change how fast people try a product and how they pay. Send these with the decision; with none, Zigbongo learns one trial length for everyone. Inputs explains how values are handled.
What to expect
Trial length tests are slow by nature, because the outcome is. How Zigbongo bridges the wait depends on whether you send context (inputs). A decision point without inputs counts what is known so far: payments count as they arrive, a sign-up that hasn't paid yet counts as zero for now, and the final value replaces both when the window closes. That has one predictable effect: longer trials look worse at first, because their customers pay later. Expect traffic to lean towards the short trial in the first weeks, and to move back if the long one earns more once its windows close. A decision point with inputs learns from each sign-up only once its window has closed: no early lean, and no early learning either.
The report is stricter. A sign-up whose window is still open is pending, neither zero nor part of the comparison. So the first lift reading comes no sooner than one window after launch, once each side also has 20 sessions with a payment. 5% of new accounts keep your current trial, chosen per account and fixed for the life of the flow; their revenue per session is the baseline, with a 95% interval. See sessions and outcomes and holdout and lift.
Two or three lengths learn faster than six. Personalizing by source or country needs more sign-ups than finding one answer for everyone.
Guardrails
- Honest terms. Show each customer the trial terms that apply to them. Every option you send is yours, under consumer law, as our terms say.
- A pseudonymous subject. Use your account id, never an e-mail address, so the same id reaches Zigbongo from sign-up and from billing.
- A kill switch. Pause the flow and new sign-ups get your default trial within seconds.
Sessions are counted at sign-up, not for each payment you report; see pricing. For the screen before the trial, see paywalls and pricing; for what happens when a customer later tries to leave, see retention and save offers. How it works covers the learning itself.