Learn how to test different component variants within a single funnel step. There are two ways to set up a split test container depending on how your page is built.Documentation Index
Fetch the complete documentation index at: https://docs.elasticfunnels.io/llms.txt
Use this file to discover all available pages before exploring further.
Looking to split test entire pages or branches at the funnel level? See Funnel Split Testing.
Using the Page Builder
Use this approach if you’re building your page visually in the page builder.Step 1: Create Components
Right-click an element in the page builder and select Create a new component, or build the component from scratch. Repeat for each variant you want to test.Step 2: Add a Split Test Container
Add a Split Test Container to your page and give it a descriptive name. The name is what appears in Page Events when you configure the test.Step 3: Configure in Page Events
Open Page Events for the page and connect a Component Split Test node:- Click Add Node → Component Split Test
- Select the container by name
- Set the traffic percentage for each variant and assign a component to each
Step 4: Connect the Node
Connect the Component Split Test node to the Entry Node or a Script Rule node to activate it.Using Coded Pages
Use this approach if you’re writing page HTML directly (coded pages, custom templates). The<split-test> tag marks a section of the page as a split test zone. The tag itself is just a placeholder — all behavior (which component variant each visitor sees and at what traffic split) is defined entirely in Page Events using the Component Split Test node. The server reads that configuration at render time and replaces the tag with the winning variant.
<split-test> tag
Attributes
| Attribute | Required | Description |
|---|---|---|
id | Yes | Unique identifier used by the server to match and replace this container with the winning variant. Must match the container ID configured in the Page Events Component Split Test node. |
name | Yes | Human-readable label shown in the Page Events UI when selecting which container to target. Without this the container will not appear in the Page Events dropdown. |
@component('...') embeds a saved Custom Component by its code. See the @component directive reference for full details.
How it renders
When a matching Component Split Test node is active in Page Events, the server replaces the entire <split-test> block with the resolved component variant:
- Add a Component Split Test node
- Set Container →
Headline Test(matched byname) - Assign variants: 50% →
headline-variant-a, 50% →headline-variant-b
<split-test> acts as the control (variant A) and is also the fallback shown when no Component Split Test node is active.
Example: A/B testing a video section
Inline Split Testing (Coded Pages)
Use<inline-split-test> when you want to A/B test content directly in the HTML without creating separate components or configuring Page Events. Variants and their content live inside the tag itself.
This is the simplest way to split test on coded pages. For more advanced setups (component-based variants, multi-step funnels), use the
<split-test> container with Page Events described above.Syntax
| Element | Attribute | Required | Description |
|---|---|---|---|
<inline-split-test> | name | Yes | Human-readable name for the split test. Used as the record name in the database and analytics dashboard. The tag is ignored on save if name is missing. |
<inline-split-test> | id | Auto-generated | Database record ID. Injected automatically on save — do not set or edit manually. |
<variant> | name | Yes | Unique name for the variant. Used to identify and track the variant across saves. |
<variant> | weight | No | Traffic percentage (0–100). If omitted on all variants, traffic splits evenly. |
Basic example (equal split)
When noweight attributes are provided, traffic is distributed evenly across all variants:
Weighted example
Send 70% of traffic to the control and 30% to the challenger:Saving pages through the API
When you create or update a coded page through the public Pages API:- Send the full
<inline-split-test>...</inline-split-test>block inside thehtmlfield. - The Pages API stores that source HTML as provided.
- The create/update response does not replace the tag with the winning variant’s runtime HTML.
- The public Pages API also does not inject the auto-managed
idattribute as part ofPOST /api/brands/{brand}/pagesorPUT /api/brands/{brand}/pages/{page}.
id, and return the updated HTML.
How it works
-
On editor save, the system validates the tag structure (the
<inline-split-test>must have aname, and there must be at least 2<variant>tags each with aname). It creates a split test database record and injects anidattribute into the tag. Thenameattribute on the tag is used as the split test record name. The editor updates automatically to show the assigned ID. -
At runtime, when a visitor loads the page the server:
- Checks for an existing cookie (
st_res_{id}) to maintain consistency for returning visitors - If no cookie exists, selects a variant using deterministic weighted rotation (Redis-backed for consistency across servers)
- Sets a 7-day cookie with the selection
- Replaces the entire
<inline-split-test>block with just the chosen variant’s HTML
- Checks for an existing cookie (
-
Tracking is automatic. The rendered output includes
data-sidanddata-cidattributes, which the built-in tracking script picks up to firesplit-test-viewevents. These appear in your analytics dashboard alongside regular split tests. - Conversion attribution works out of the box. The split test cookie is included in conversion and click payloads, so you can see which variant drove each purchase.
Server output
At runtime the tag is replaced with:variant_code is an internal identifier (e.g. v0, v1) that maps back to the variant name in the analytics dashboard.
Rules
- The
<inline-split-test>tag must have anameattribute. Tags without a name are ignored on save (no split test record is created or updated). - Minimum 2 variants required, each with a unique
name. - Weights must be positive numbers that sum to 100. If no weights are set on any variant, traffic splits evenly.
- Do not manually set or edit the
idattribute — it is managed by the system. - Removing the tag from the page does not delete or deactivate the split test record. The record stays active in the database. To deactivate a split test, use the split test management UI.
- Variant identity is tracked by name. Existing variants keep their internal tracking code (
v0,v1, etc.) across saves. Renaming a variant in the HTML creates a new variant with a new code — the original variant and its analytics data remain in the record. Removing a variant from the HTML does not delete it from the split test record.
Tips for Effective Split Testing
- Test one element at a time for clear results
- Run tests long enough to get statistical significance
- Monitor performance metrics closely
- Document your test results for future reference