A/B Testing
How Spara supports A/B and multivariate testing of agent behavior.
Spara lets you test multiple agents side by side to measure which performs better before rolling out changes to all your traffic. This helps you iterate on your sales conversations with confidence, without risking your funnel performance.
What can be tested
Anything unique to an agent can be tested, including:
AI instructions (prompt) — Test different conversational styles, objection handling, or qualification approaches
Preview messages — Test different pop-up messages to see which drives more engagement
Suggested responses — Test different suggested reply buttons
Media and calendars — Test whether showing a video or calendar at different points improves conversion
Since each agent has its own configuration, you can test any combination of these variables by creating separate agents with different settings.
How to set up an A/B test
A/B tests are managed through the Experiments panel on the Agents page and through each agent's Overview tab. No setup from the Spara team is required.
Create a variant
Open the Agents page and find the chat agent you want to test.
In the Experiments panel, click Create variant. The variant inherits the control's trigger automatically.
Configure the variant's prompt, preview message, suggested responses, media, or calendar — whatever you're testing.
Use the breadcrumb switcher at the top of any agent in the experiment to jump between the control and all variants. Each shows a Published or Draft badge so you can see what's live at a glance.
Set the traffic split
In the Experiments panel, adjust the traffic percentage for each variant. The control receives whatever traffic isn't allocated to variants. Traffic is split deterministically — the same visitor always sees the same agent.
Manage variants
Archive a variant to stop it receiving traffic without deleting it. Archived variants can be restored later.
Promote a variant to control if it outperforms the original. The promoted variant takes over the control role and the former control becomes a variant.
Each agent's Overview tab shows its current role (control, variant, or archived), its inherited trigger, and its share of traffic.
How traffic splitting works
Spara uses an experiment_hash function to deterministically assign each visitor to a group. The function takes the visitor's unique identifier and an experiment name, and produces a consistent number. This means:
The same visitor always sees the same agent (no mid-conversation switching)
The split is random and evenly distributed
You control the percentage using the traffic controls in the Experiments panel
Assigning leads to groups
To track which group each lead was in, configure each agent to assign a field value when it activates. For example:
Control agent assigns
experiment_group = "control"Experiment agent assigns
experiment_group = "experiment"
This field persists on the lead record, so you can filter analytics and exports by group even after the experiment ends.
Measuring results
Use the Analytics page to compare performance between your agents. Use the Agent filter to view metrics for each agent individually, then compare:
Leads engaged — Which agent drives more conversations?
Calls scheduled — Which agent converts more leads to meetings?
Emails collected — Which agent captures more contact information?
Conversation length — Are leads more or less engaged with each variant?
How long to run a test
Run your test until you have enough data to be confident in the results. As a general guideline, aim for at least 100 engaged leads per variant before drawing conclusions. High-traffic sites may reach significance in days; lower-traffic sites may need several weeks.
Using third-party analytics tools
Spara does not natively integrate with third-party A/B testing tools. The approach below describes a custom integration using Spara's APIs.
You can use Spara's Web API or Javascript API to connect an external experimentation platform (e.g., Amplitude, LaunchDarkly) with Spara's agent routing:
Set up your experiment in the third-party tool, assigning visitors to groups
Use the Spara Javascript API to set a field on each visitor (e.g.,
experiment_group = "control")Configure your Spara agents to activate based on that field value
Do not switch a visitor's agent mid-conversation. Only assign the experiment group before the first interaction.
Loading Spara for only some visitors
To show Spara to only a percentage of website visitors, you can conditionally load the embed snippet:
Set SPARA_TRAFFIC_PERCENTAGE to control the percentage. The assignment persists for 30 days so returning visitors stay in the same group.
It is usually simpler to load Spara for 100% of visitors and use the agent-based A/B testing approach instead. Configure a "control" agent that shows only the avatar (no preview message) and an "experiment" agent that shows a pop-up — this achieves the same result without needing to modify your embed code.
Last updated