Complete Documentation
Everything you need to master Segmently - from installation to advanced experimentation
Quick Start
- 1
Install the Snippet
Add the Segmently script to your website's
<head>section. - 2
Create Your First Project
Projects organize your experiments and generate API keys for tracking.
- 3
Design Your Experiment
Define variants, set targeting rules, and configure goals using our visual editor or code.
- 4
Launch & Analyze
Start your experiment and watch real-time analytics to determine the winning variant.
Dashboard Features
Projects
Organize experiments by website or application
What is a Project?
A Project represents one website or application. Each project has its own API key, experiments, and analytics. If you have multiple websites, create separate projects for each.
Creating a Project:
- Click "+ New Project" from Projects page
- Enter project name (e.g., "Main Website", "E-commerce Store")
- Click "Create Project"
- Project is created with unique API key instantly
Project Page Sections:
- Experiments: List of all experiments (active, paused, archived)
- Quick Actions: Start, Pause, Resume, Archive, Reinstate, View Analytics, Edit
- API Key & Installation (Accordion): Copy snippet code for website installation
- Integration Guides (Accordion): Platform-specific instructions
Project Limits by Tier:
- Free: 1 project
- Professional: 1 project
- Business: 1 project
- Enterprise: Unlimited projects
Project Deletion:
- Navigate to Project → Settings
- Scroll to "Danger Zone"
- Click "Delete Project" (requires confirmation)
- ⚠️ Warning: Deletes ALL experiments and analytics data permanently
Experiments Overview
Complete guide to A/B testing experiments
What is an Experiment?
An experiment is an A/B test where you show different versions (variants) of a page to visitors and measure which performs better. Segmently handles assignment, tracking, and statistical analysis automatically.
Experiment Creation Process:
- Step 1: Details (name, description, hypothesis)
- Step 2: Variants (Control + variations)
- Step 3: Targeting (URL rules, device types)
- Step 4: Goals (conversion metrics)
- Step 5: Review & Launch
Experiment States:
- Draft: Being configured, not visible to visitors
- Live: Running and tracking visitors
- Paused: Temporarily stopped (data preserved)
- Archived: Completed/ended (removed from active list)
Quick Actions Menu (3-dot icon):
- ▶️ Start (Draft → Live)
- ⏸️ Pause (Live → Paused)
- ▶️ Resume (Paused → Live)
- 📦 Archive (Any state → Archived)
- ♻️ Reinstate (Archived → Draft)
- 📊 View Analytics (All states)
- ✏️ Edit (Draft/Paused only)
- 🗑️ Delete (Permanent removal)
Experiment Limits by Tier:
- Free: 1 experiment
- Professional: 1 experiment
- Business: 2 experiments
- Enterprise: Unlimited experiments
Experiment Configuration Tabs
Details Tab
Basic experiment information and hypothesis
Fields:
- Experiment Name: Internal identifier (e.g., "Homepage Hero Test")
- Description: What you're testing and why
- Hypothesis: Expected outcome (e.g., "Changing CTA color to green will increase conversions by 15%")
- Activation Delay: Time before revealing experiment (prevents flicker)
Activation Delay Options:
- Immediate (0ms): Show changes instantly
- Fast (100ms): Brief wait for scripts
- Standard (500ms): Allow dependencies to load
- Safe (1000ms): Ensure all assets loaded
- Custom: Enter any millisecond value
Why Activation Delay Matters:
If your site uses JavaScript that modifies the DOM after page load (e.g., React, Vue, Angular), setting an activation delay ensures Segmently's changes are applied AFTER your framework initializes, preventing conflicts or reverts.
Best Practices:
- Use descriptive names (searchable, clear purpose)
- Write specific hypotheses (measurable, testable)
- Start with 100ms delay for most sites
- Increase to 500ms if using React/Vue/Angular
Variants Tab
Create and configure experiment variations
What are Variants?
Variants are different versions of your page shown to visitors. Every experiment has a Control (original) and one or more Variations (your changes).
Control Variant:
- Always exists (cannot be deleted)
- Represents the original page (baseline)
- Can be customized like any other variant!
- ⚠️ Control does NOT mean "unchanged site" - it's just another variant
Creating Variations:
- Click "+ Add Variation"
- Enter variation name (e.g., "Green Button", "Shorter Form")
- Set traffic weight (percentage of visitors)
- Add changes using Visual Editor or Custom Code
Traffic Weights:
- Must sum to 100% across all variants
- 50/50 split: Control 50%, Variation A 50%
- 33/33/34 split: 3 variants equally distributed
- Custom: 25/75, 10/45/45, etc.
Change Types:
- Hide Element: Remove from DOM
- Replace Text: Change wording
- Custom CSS: Style modifications
- Custom JavaScript: Advanced DOM manipulation
Visual Editor Integration:
- Click "Visual Editor" button
- Website loads in iframe
- Hover over elements (blue highlight)
- Click to select element
- CSS selector auto-generated
- Apply changes and save
Selected Element Tiles:
- Each tile prefers the first direct text node of the selected element
- If none exists, it falls back to the first immediate child element text
- If still empty, it uses the first descendant element's direct text before final fallback
- Container-wide concatenated text is avoided for cleaner labels
- This improves identification for nested structures and non-visible elements
Nested Element Reliability:
- When parent and child are both selected, parent changes apply first
- Child element changes apply after parent to prevent unintended overrides
- Saved element changes reapply when reopening the modal after elements are ready
- HTML updates prioritize exact selector matches before using safe fallback
- Selected elements default to visible unless you explicitly choose hidden or removed
- Selected elements with empty HTML (not edited) are ignored to prevent child wipe
- Pending selected-element apply cycles are preserved across snippet reinitialization
- Preview-link mode applies selected elements with the same retry/depth safeguards
- Clearing custom CSS removes previously applied inline properties for that selector
- Localhost preview bypasses session cache to always load fresh experiment changes
- If your page is highly dynamic, keep Activation Delay at 100-500ms for best consistency
On-Site Test Panel:
- When previewing an experiment, a floating Test Panel appears in the bottom-right corner of your page
- Shows the active experiment name and the currently selected segment
- Use the segment dropdown to switch to any other segment without editing the URL manually
- Click View Original to remove the preview parameter and see the unmodified site
- Click Dashboard to open the experiment in a new tab
- Minimize the panel with the ▼ button; its state is remembered across page navigations in the same session
- The panel is CSS-isolated and cannot conflict with your site's styles
Targeting Tab
Control where and to whom experiments are shown
URL Targeting:
- Exact: https://example.com/pricing (only this URL)
- Contains: /product/ (anywhere in URL)
- Starts With: https://example.com/blog/ (all blog posts)
- Ends With: /checkout (any checkout page)
- Regex: ^https://example\.com/product/[0-9]+$ (advanced)
Multiple URL Rules:
- Add multiple rules (OR logic)
- Experiment runs if ANY rule matches
- Example: Target /checkout OR /cart
Device Targeting:
- All Devices: Desktop, mobile, tablet (default)
- Desktop Only: Screen width ≥ 1024px
- Mobile Only: Screen width < 768px
- Tablet Only: 768px ≤ width < 1024px
Location Targeting:
- Target visitors by country using ISO 3166-1 alpha-2 codes (e.g. US, GB, DE)
- Only visitors from selected countries are bucketed into the experiment
- Leave the list empty to include all countries (default)
- Visitors whose country cannot be detected are always allowed through
Traffic Percentage:
- Control what % of visitors see experiment
- 100%: All matching visitors participate
- 50%: Only half of visitors see experiment
- 10%: Run on small sample before full rollout
- Useful for testing impact before wide deployment
How Targeting Works:
- Visitor lands on your website
- Snippet checks current URL against rules
- If no match, experiment is skipped
- If match, check device type
- If device matches, check visitor country against geo targeting rules
- If country matches (or no geo rules set), check traffic percentage
- Assign to variant using deterministic hashing
- Apply changes and track events
Goals Tab
Define success metrics and conversion tracking
What are Goals?
Goals define what "success" means for your experiment. Most experiments track conversions (purchases, signups, clicks), but you can also track custom events and multi-page funnels.
Primary Conversion Goal: How It Connects to Analytics
💡 The Primary Conversion Goal is the direct source of the Conversions tile and Conversion Rate shown on your analytics dashboard. When a visitor triggers your goal (clicks a button, submits a form, reaches a thank-you page, or fires a custom JS event), the snippet sends a conversion event to the API, which is exactly what the analytics tile counts. There is no separate system; the goal is the conversion counter.
- The main metric you're optimizing for
- Used for winner determination in analytics
- Without a Primary Goal set, conversions are only recorded if you manually call
window.Segmently.track('conversion')in your own code - Secondary goals also fire as
conversionevents (with a different goal_name in metadata) and contribute to the same count
Goal Types:
- Click Element: Tracks clicks on a CSS selector (e.g.
#buy-button) - Form Submit: Tracks when a matching form is submitted
- Page View: Tracks when a visitor reaches a specific URL (e.g.
/thank-you) - Custom Event: Tracks a named JS event fired via
window.Segmently.track()
Page View Goal Setup:
1. Choose "Page View" as goal type
2. Enter conversion URL: /thank-you
3. Snippet fires a conversion event whenever
a bucketed visitor lands on that URLCustom Event Goal:
// Fire from your own JavaScript
window.Segmently.track('purchase_complete', {
value: 99.99
});
// The event name must match what you entered
// in the "Event Name" field of the goal configBest Practices:
- Set a Primary Goal before launching; without one, the Conversions tile will always show 0
- Choose ONE clear primary goal per experiment (e.g. purchase, signup, not both)
- Make sure the goal is binary (yes/no per visitor per session)
- Test goal firing in the browser console before launching
Multi-Page Funnel Goals (Professional+)
Track sequential page visits as a multi-step conversion funnel
What are Funnel Goals?
Funnel goals let you define an ordered sequence of pages a visitor must visit, in order, to count as a conversion. Unlike a single-page goal, funnels reveal where visitors drop off across a multi-step flow (e.g., landing page → product page → checkout → confirmation).
Requires Professional plan or higher. The section is visible in the experiment wizard for all plans, but funnel evaluation is only active for Professional, Business, and Enterprise accounts.
Adding Funnel Steps:
- Open the Metrics tab in the experiment wizard
- Scroll to the Multi-Page Funnel Goals section
- Click + Add Step for each page in the flow
- Fill in the three fields for each step (see below)
- Steps are evaluated in order, top to bottom
Step Fields:
- Step Label: A human-readable name shown in analytics (e.g., "Landing Page", "Add to Cart", "Checkout", "Purchase Confirmed")
- URL (contains): The URL path pattern that defines this step (see URL matching rules below)
- Event Name (optional): A custom event name that can also satisfy this step (e.g.,
add_to_cart). Either the URL match or the event fires; whichever comes first counts.
URL Field: Matching Rules
- Empty value or
/→ matches the root domain homepage only (i.e.,pathname === "/"). Both are treated identically, so leaving the field blank and entering/produce the same result. - Any other value (e.g.,
/checkout,/product) → matches any URL whose pathname contains that string. - Matching is case-sensitive and path-only (the hostname is ignored).
Example: E-commerce Funnel
Step 1: Landing Page
Label: Landing
URL: / ← matches homepage only
Event: (empty)
Step 2: Product Page
Label: Product
URL: /product ← matches /product, /products/123, etc.
Event: (empty)
Step 3: Added to Cart
Label: Add to Cart
URL: /cart
Event: add_to_cart ← fires if JS calls Segmently.track('add_to_cart')
Step 4: Checkout
Label: Checkout
URL: /checkout
Event: (empty)
Step 5: Purchase Confirmed
Label: Confirmed
URL: /thank-you
Event: purchaseTriggering Funnel Events Manually:
For steps where a URL visit isn't enough (e.g., a single-page checkout), use the JS API to fire a step event:
// Fire a named event to satisfy a funnel step
window.Segmently.track('add_to_cart');
// With optional metadata
window.Segmently.track('purchase', { value: 99.99, currency: 'USD' });How to Test Funnel Goals:
- Create an experiment with funnel steps and set status to Draft
- Open your site with the preview URL:
yoursite.com?segmently_preview=your-slug:your-segment-id - Navigate through each page in order (e.g., visit homepage → /product → /checkout → /thank-you)
- On pages that use event-based steps, open the browser console and run:
window.Segmently.track('your_event_name'); - After completing all steps, check Dashboard → Analytics for your experiment to see funnel completion data
- To verify events are being recorded, check the network tab in DevTools for POST requests to
/api/v1/events/track
Funnel Analytics (What You'll See):
- Per-variant completion rate at each step
- Drop-off percentage between consecutive steps
- Overall funnel completion rate (step 1 through final step)
- Comparison across Control and all Variants
Tips & Limitations:
- Steps must be completed in sequence; visiting step 3 before step 2 does not count
- A visitor who completes only steps 1 and 2 is counted as a drop-off at step 3
- The same visitor completing the funnel multiple times is deduplicated (counted once)
- Leave the URL blank (not
/) when you want the step satisfied purely by a custom event - For SPA sites where URLs don't change on navigation, rely entirely on event-based steps
Advanced Tab
Custom code, experiment scheduling, and third-party integrations
Experiment Scheduling (Business+):
- Start Date: Set a future date/time to automatically activate the experiment
- End Date: Set a date/time after which the experiment automatically pauses
- Auto-pause at significance: Toggle to have the experiment pause itself once a variant reaches 95% statistical confidence (requires 30+ visitors per variant)
- Scheduling checks run every 60 seconds server-side; no manual intervention needed
- Useful for timed promotions, product launches, and campaigns across time zones
- You can schedule an experiment from the ellipsis menu on the project page: click the three-dot menu next to any draft experiment and choose Schedule
Cross-Domain Tracking:
- Keeps a visitor in their assigned variant when they navigate from one of your domains to another (e.g. a marketing site to a separate checkout domain)
- Requires the Segmently snippet to be installed on every domain you want to track across, all using the same project API key
- Enable it in the Advanced tab, then enter a comma-separated list of the domains you want to bridge (e.g.
store.example.com, checkout.example.com) - The snippet automatically appends
?_sgmt_vid=<visitor_id>to every outbound link pointing to your listed domains; aMutationObserverhandles links added dynamically after page load (SPAs, lazy-loaded content) - When the visitor lands on the second domain, that domain's snippet reads
_sgmt_vid, adopts the visitor ID (matching the existing assignment record), then strips the parameter from the URL bar so it never appears in the address bar or gets bookmarked - Both domains must be on the same Segmently project; the same API key is shared across all of them
Integrations (Business+):
- Slack Webhook: Enter a Slack Incoming Webhook URL to receive a notification when your experiment reaches statistical significance
- GA4 Measurement ID: Enter your GA4 Measurement ID (e.g., G-XXXXXXX); the snippet automatically calls
gtag('event', 'experiment_impression')when a visitor is bucketed, syncing experiment and variant names into GA4 - Mixpanel Project Token: Enter your Mixpanel Project Token; the snippet calls
mixpanel.track('$experiment_started')automatically (requires Mixpanel SDK already on page) - Outbound Webhook URL: Enter any HTTPS endpoint; Segmently will POST a JSON payload for each configured experiment event (experiment.started, experiment.paused, significance.reached)
- GA4 and Mixpanel forwarding only fires if the respective library (
window.gtag/window.mixpanel) is already loaded on the client page
Custom JavaScript:
// Example: Change button text dynamically
document.querySelector('.cta-button')
.textContent = 'Start Free Trial';
// Example: Add click event listener
document.querySelector('.hero-cta')
.addEventListener('click', () => {
window.Segmently.trackConversion();
});Custom CSS:
.hero-section {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 80px 20px;
}
.cta-button {
background-color: #10b981;
color: white;
font-weight: bold;
border-radius: 8px;
}Execution Order:
- Anti-flicker CSS injected (hides page)
- Experiment configuration fetched
- Variant assigned to visitor
- Integration events forwarded (GA4, Mixpanel)
- Visual Editor changes applied
- Custom CSS injected
- Custom JavaScript executed
- Wait for activation delay
- Anti-flicker removed (page revealed)
Best Practices:
- Test code in browser console first
- Use querySelector carefully (may not exist yet)
- Add error handling for missing elements
- Keep code minimal (performance impact)
- Comment complex logic for future reference
- Use the built-in Prism syntax highlighting to quickly validate selectors, properties, and JavaScript tokens while editing
⚠️ Warning:
Custom code executes on every page view. Ensure it's efficient and doesn't break functionality. Always test in preview mode before launching!
Integrations Tab (Business+)
Connect experiments to Slack, GA4, Mixpanel, and custom webhooks
The Integrations tab lets you forward experiment data to external analytics and notification tools. All integration settings are saved per-experiment inside the integrations field.
Slack Notifications (Professional+):
There are two levels of Slack integration: org-level (15 event types) and per-experiment override.
- Org-level (recommended): Configure a single Slack webhook and choose which of the 15 event types to receive; go to Organization → Features & Integrations. Covers experiment lifecycle, project events, member changes, and billing alerts.
- Per-experiment override: Paste a Slack Incoming Webhook URL here to send notifications for this experiment only. Fires on
experiment.started,experiment.paused,experiment.archived, andsignificance.reached. - The
significance.reachedevent fires automatically (exactly once per experiment) when a variant's two-proportion z-test confidence first crosses 95%. - Message includes experiment name, winning variant, confidence level, and a direct link to the results page.
- Create Incoming Webhooks at
api.slack.com/apps→ your app → Incoming Webhooks.
Google Analytics 4 (Business+):
- Enter your GA4 Measurement ID (format:
G-XXXXXXXXXX) - The Segmently snippet auto-fires
gtag('event', 'experiment_impression', { experiment_name, variant_name })when each visitor is bucketed - Requires the GA4 global site tag (
window.gtag) to already be present on your page - Use BigQuery Export or GA4 Explore reports to cross-segment with experiment variants
Mixpanel (Business+):
- Enter your Mixpanel Project Token
- The snippet fires
mixpanel.track('$experiment_started', { experimentName, variantName })automatically - Requires the Mixpanel SDK (
window.mixpanel) to be loaded on your page before the Segmently snippet runs
Outbound Webhook (Business+):
- Enter any HTTPS endpoint URL
- Choose which events to subscribe to:
experiment.started,experiment.paused,significance.reached - Segmently POSTs a JSON payload with experiment ID, variant info, timestamp, and event type
- Useful for custom dashboards, CRM updates, or CI/CD pipeline triggers
All integrations require a Business plan or higher, except Slack which is available on Professional+. Integration config is stored in the integrations JSONB column on the experiment record.
Core Features
Experiment Lifecycle Management
Full control over experiment status from draft to archived
Experiment States:
- Draft: Being configured, not live yet
- Live: Running and tracking visitors
- Paused: Temporarily stopped (data preserved)
- Archived: Completed/ended (removed from active list)
Quick Actions:
- ▶️ Start: Launch draft experiments
- ⏸️ Pause: Temporarily stop tracking
- ▶️ Resume: Continue paused experiments
- 📦 Archive: Move to archived list
- ♻️ Reinstate: Restore archived experiments
View Options:
- Active experiments shown by default
- Archived experiments in collapsible section
- Count badge shows archived experiments (e.g., "3 Archived")
Anti-Flicker Protection
Zero flickering for experiment participants with customizable activation delays
How It Works:
- Snippet injects CSS to hide page content immediately
- Fetches experiment configuration and variant assignment
- Applies changes (DOM manipulation, CSS injection)
- Waits for activation delay (0ms, 100ms, 500ms, 1s, or custom)
- Removes anti-flicker to reveal final result
Activation Delay Options:
- Immediate (0ms): Show changes instantly
- Fast (100ms): Brief wait for scripts to load
- Standard (500ms): Allow dependencies to initialize
- Safe (1000ms): Ensure all assets loaded
- Custom: Set your own timing
Failsafe:
- 5-second timeout always reveals content (prevents permanent hiding)
- Users assigned to variant ONLY see their variant (never original first)
- All segments can be customized (Control is NOT special)
Creating Experiments
Design and launch A/B tests with URL targeting, device segmentation, geo targeting, and traffic control
Experiment Setup:
- Create unlimited variants with custom names
- Set traffic allocation (50/50, 33/33/34, custom weights)
- Control traffic percentage (run on 10%, 50%, 100%)
URL Targeting:
- Exact match: https://example.com/page
- Contains: /product/ anywhere in URL
- Starts with: https://example.com/blog/
- Ends with: .html or /checkout
- Regex: Advanced pattern matching
Device Targeting:
- Desktop only, mobile only, or tablet only
- All devices (default)
Geo / Country Targeting:
- Target by country using ISO 3166-1 alpha-2 codes (US, GB, DE, CA, etc.)
- Visitors from non-listed countries are excluded from the experiment
- Leave empty to allow all countries (default)
Visual Editor (Detailed Guide)
Point-and-click interface powered by snippet-based element selection
What is the Visual Editor?
The Visual Editor lets you select elements on your website by hovering and clicking - just like Optimizely. No CSS selector knowledge required! It uses the Segmently snippet already installed on your site.
How It Works (Technical):
- Visual Editor opens your website in iframe
- Snippet detects it's in iframe and sends "ready" message
- Editor enables selection mode in snippet
- Snippet adds hover overlay and click handlers
- User hovers → blue highlight appears
- User clicks → element data sent to editor
- Editor displays CSS selector and element details
- User applies changes (hide, text, CSS)
Opening Visual Editor:
- Go to Experiment → Variants tab
- Select a variant (Control or Variation)
- Click "Visual Editor" button
- Enter URL to edit (or use target URL)
- Modal opens with your website loaded
Element Selection:
- Hover: Blue overlay highlights element
- Click: Element selected, details shown
- Info Displayed: Tag name, classes, ID, text content
- CSS Selector: Auto-generated (e.g., .hero-section .cta-button)
- Manual Override: Edit selector if auto-gen isn't specific enough
Change Types You Can Apply:
- Hide Element: display: none (removes from page)
- Replace Text: Change button text, headlines, etc.
- Custom CSS: Color, size, position, fonts, etc.
- Custom JavaScript: Advanced DOM manipulation
⚠️ Snippet Required:
If you see "Segmently Snippet Required" banner, the snippet isn't installed on your website yet. Add it to the <head> tag and refresh. Visual Editor only works when snippet is present!
Why This Approach?
- ✅ Works with modern SPAs (React, Next.js, Vue, Angular)
- ✅ No CORS issues (snippet runs on your domain)
- ✅ No browser extension required
- ✅ No bookmarklet to paste
- ✅ Works automatically (snippet already installed)
- ✅ Identical to Optimizely's approach
Troubleshooting:
- Element selection not working? Check if snippet is installed (view browser console for "✅ Segmently loaded")
- Wrong element selected? CSS selector may need refinement - edit manually
- Changes not showing? Check selector matches intended element (use browser DevTools)
- Website not loading? Check for X-Frame-Options header blocking iframes
Best Practices:
- Test selectors in browser DevTools first (document.querySelector)
- Use specific selectors (avoid body > div > div)
- Prefer classes over IDs when possible
- Preview changes before saving
- Test on mobile/desktop if targeting multiple devices
Alternative: Manual CSS Selectors:
If Visual Editor isn't working or you prefer manual control, you can enter CSS selectors directly in the Variants tab. Use browser DevTools to find selectors: Right-click element → Inspect → Copy selector.
Analytics & Results Dashboard (Complete Guide)
Understand metrics, statistical significance, and winner determination
Accessing Analytics:
- Experiment-Specific: Experiment menu → "View Analytics" (available for all states)
- Overall Dashboard: Main navigation → "Analytics" (cross-project view)
Key Metrics Explained:
1. Total Visitors
- Count of unique visitors assigned to each variant
- Tracked via page_view events
- Visitor = unique visitor_id (determined by fingerprinting or cookie-free ID)
- Same visitor seeing page multiple times = 1 visitor (not multiple)
2. Conversions
- Count of visitors who completed your goal
- Tracked via conversion events (trackConversion() or URL-based)
- Multiple conversions from same visitor = 1 conversion
- Binary metric: Either converted or didn't
3. Conversion Rate
- Formula: (Conversions / Total Visitors) × 100
- Expressed as percentage (e.g., 5.2%)
- Primary metric for winner determination
- Example: 52 conversions / 1000 visitors = 5.2%
4. Statistical Significance
- Measures confidence that a variant's improvement is real and not due to random chance
- Calculated using a two-proportion z-test, the industry-standard method for A/B test analysis
- Compares each treatment variant's conversion rate against the Control variant
- Formula:
z = |p2 − p1| / √(pPooled × (1−pPooled) × (1/n1 + 1/n2)) - Expressed as a percentage confidence level (e.g., 95%, 99%)
- 95%+ = Statistically significant; winner is declared
- <95% = Inconclusive; keep collecting data
- Requires at least 10 visitors per variant to compute (returns 0 otherwise)
5. Confidence Level
- Directly derived from the z-test p-value:
confidence = (1 − pValue) × 100 - Capped at 99.9% to prevent misleading "100% certain" displays
- 95% confidence = 95 in 100 experiments would show the same outcome
- 99% = Very strong result; rare to be wrong
- When significance is first reached, a
significance.reachedSlack / webhook notification fires automatically (once per experiment)
6. Duration
- Number of days experiment has been running
- Calculated from launch date to now
- Minimum 7-14 days recommended for most tests
- Accounts for weekly traffic patterns
7. Average Time on Page
- Average seconds visitors spend on page
- Engagement metric (higher = more engaged)
- Tracked automatically by snippet
- Excludes bounces (<5 seconds)
8. Bounce Rate
- Percentage of visitors who left without interaction
- Formula: (Bounces / Total Visitors) × 100
- Lower = better (means people engage)
- Bounce = <5 seconds on page or immediate exit
9. Revenue (Optional)
- Total revenue attributed to each variant
- Tracked via trackConversion({ value: 99.99 })
- Useful for e-commerce experiments
- Shows average order value per variant
Winner Determination Logic:
- Fetch all variant analytics (visitors, conversions, conversion rate)
- Run a two-proportion z-test comparing each treatment variant against Control
- Winner = the treatment variant with the highest z-test confidence that also beats Control's conversion rate
- If the winning confidence ≥ 95%, a winner is declared and the banner is shown
- If no variant reaches 95% confidence, show "No clear winner yet; collect more data"
- The first time 95% is reached, a one-time
significance.reachednotification fires via Slack / outbound webhook
Winner Callout Banner:
- Green banner at top when winner found
- Shows variant name and conversion rate
- Displays confidence level (e.g., "97% confidence")
- Only appears when 95%+ threshold met
Variant Performance Comparison:
- Side-by-side cards for each variant
- Shows all key metrics in one view
- Visual bars indicate conversion rate differences
- Best performer highlighted with border/badge
- Sort by visitors, conversions, or rate
Overall Analytics Dashboard:
- Cross-project view of all experiments
- Filter by: Project, Status, Time Range (7d/30d/90d/all)
- Sortable table by: Date, Visitors, Conversions, Rate
- Quick links to experiment-specific analytics
- Summary stats: Total experiments, active, paused, archived
When to Stop an Experiment:
- ✅ Winner declared with 95%+ confidence
- ✅ Run for at least 7-14 days (capture weekly patterns)
- ✅ Sufficient sample size (1000+ visitors recommended)
- ⚠️ Don't stop early just because one variant looks better
- ⚠️ Statistical significance may be false positive with small sample
Best Practices:
- Run experiments for full weeks (Mon-Sun)
- Don't peek at results daily (increases false positives)
- Wait for 95% confidence before declaring winner
- Consider external factors (holidays, promotions)
- Validate with secondary metrics (time on page, bounce rate)
- Document learnings even if no clear winner
Timeline Visualization (Coming Soon):
- Daily visitor trends chart
- Conversion rate over time
- Spot anomalies or traffic spikes
- Export to CSV for external analysis
Event Tracking Implementation
Backend tracking for page views, conversions, and bounces
Key Metrics:
- Total visitors per variant
- Conversion count & rate
- Statistical significance (95% confidence threshold)
- Winner determination with confidence level
Engagement Metrics:
- Average time on page
- Bounce rate
- Revenue per variant (optional)
Timeline Visualization:
- Daily visitor trends
- Conversion rate over time
- Export to CSV (coming soon)
Automatic Tracking:
- Page views (tracked automatically when snippet loads)
- Bounce events (user leaves without interaction)
- Stored in PostgreSQL with JSONB metadata
Database Schema:
- events table: id, project_id, visitor_id, experiment_id, variant_id
- event_name: 'page_view', 'conversion', 'bounce'
- event_data: JSONB field for extensibility
- created_at: timestamp for analysis
Batch Tracking:
- POST /api/v1/events/batch endpoint
- Insert multiple events with transactions
- Reduces server load for high-volume projects
Assignment Tracking:
- Deterministic variant assignment (consistent hashing)
- hash(visitor_id + experiment_id) % 100 < traffic_percentage
- Stored in assignments table (UNIQUE constraint)
- Prevents duplicate assignments
- Weight-based variant distribution
Manual Tracking:
// Track conversion
window.Segmently.trackConversion();
// Track with value
window.Segmently.trackConversion({
value: 99.99
});Conversion Tracking
Track purchases, sign-ups, and custom goals
Automatic Tracking:
- Page views (tracked automatically)
- Bounce events (user leaves without interaction)
Manual Tracking:
// Track conversion
window.Segmently.trackConversion();
// Track with value
window.Segmently.trackConversion({
value: 99.99
});Project Configuration:
- Set conversion URLs (e.g., /thank-you, /success)
- Cookie-based conversion detection
- Login/registration tracking
Settings & Account Management
Settings Tabs
Complete account management across 5 specialized tabs
1. Profile Settings:
- Update name, email, organization
- View current subscription tier
- Account creation date
2. Security:
- Change password (requires current password)
- Password requirements: 6+ characters
- Password reset via email (when email service enabled)
3. Team & Permissions:
- View all team members with roles and status
- Transfer ownership (owner only)
- Suspend/activate members (owner only)
- Remove team members (owner only)
- Seat count display (e.g., "2/2 seats")
4. Notifications:
- Email notifications toggle
- Experiment results alerts
- Weekly reports (when available)
- Security alerts
5. Billing:
- View current plan and pricing
- Manage subscription (cancel, reactivate)
- Access Stripe Customer Portal
- View payment history and invoices
- Upgrade/downgrade plans
Team Management & Invitations
Collaborate with intelligent invitation flow, roles, and permissions
Team Invitation System:
- Secure Tokens: 32-byte cryptographically secure tokens
- 7-Day Expiration: Invitations expire after one week for security
- Email Verification: Checks if invited email already has an account
- Intelligent Routing: Automatically directs users to login or signup
- One-Click Acceptance: Seamless team joining experience
Invitation Acceptance Flow (3 States):
- Existing User: Redirects to login with email pre-filled, then auto-accepts invitation and adds to team
- New User: Shows invitation-focused signup form (displays team name and role), creates account, auto-logs in, joins team immediately
- Already Logged In: Auto-accepts invitation and redirects to dashboard with success message
Why This Matters:
- No duplicate accounts created by mistake
- Existing users don't need to create new credentials
- New users see the exact team they're joining before signup
- Zero friction - users land on dashboard immediately after joining
- Perfect for collaborative A/B testing teams
Team Roles:
- Owner: Full control, can transfer ownership, invite/remove members
- Admin: Manage experiments and settings (future enhancement)
- Member: View and edit experiments (future enhancement)
Member Status Badges:
- Active (Green): Can access all features
- Suspended (Red): Login/API access disabled
- Pending (Amber): Invitation sent but not yet accepted
Owner Actions:
- Invite Member: Send invitation email with secure token
- Cancel Invitation: Revoke pending invitations before acceptance
- Transfer Ownership: Make another member the owner
- Suspend Member: Temporarily block access (no login, API disabled)
- Activate Member: Restore suspended account
- Remove Member: Delete from team permanently (with restrictions)
Team Member Removal Rules (Critical Business Logic):
- Cannot Remove Yourself: Owner must transfer ownership first before leaving
- Must Have One Member: Organizations must have at least one active member
- Must Have One Admin: At least one owner/admin must remain
- Owner-Only Action: Only owners can remove team members
- UI Feedback: Disabled remove button shows reason (e.g., "Last admin", "You")
Why Removal Rules Matter:
- Prevents accidental organization lockout
- Ensures continuous access to projects and experiments
- Protects data ownership and billing continuity
- Forces proper ownership transfer process
Team Limits by Tier:
- Free: 0 additional members (just you)
- Professional ($299/mo): 1 team member
- Business ($999/mo): 3 team members
- Enterprise ($9,999/mo): Unlimited team members
Invitation Security:
- Tokens validated on every acceptance attempt
- Expired invitations automatically rejected
- One-time use tokens (cannot reuse after acceptance)
- Email verification prevents unauthorized access
- Invitation cancellation instantly invalidates tokens
Use Cases:
- Agencies: Collaborate with clients on their experiments
- Marketing Teams: Multiple marketers managing A/B tests
- Product Teams: Engineers, designers, PMs working together
- Organizations: Each organization maintains separate team structure
- Multiple Organizations: Enterprise users can create additional organizations and switch between them from the header menu
Multiple Organizations (Enterprise)
Create and switch between independent organizations from one login. Enterprise plans only.
Enterprise accounts can create and switch between multiple organizations. Each organization operates independently with its own projects, experiments, team members, and billing.
How to Create a New Organization:
- Open the header menu (top right)
- Click your organization name to open the org switcher
- Click New organization
- Enter a name and press Enter or click Create
How to Switch Organizations:
- Open the header menu
- Click your current organization name to open the org switcher
- Click any organization in the list to switch to it
Each Organization Has Its Own:
- Projects and experiments
- Team members and roles
- Subscription and billing
- API keys and integrations
- Analytics data
Common Use Cases:
- Agencies: Separate organizations per client to keep data isolated
- Enterprise teams: Different business units with independent billing
- White-label: Brand-specific organizations for resellers
Available on Enterprise plans only. Non-Enterprise users can still be added as members of Enterprise-owned organizations by their team owners.
Project Configuration
Manage projects, API keys, and conversion settings
Project Settings:
- Set project base URL
- Configure conversion tracking methods
- Define login/registration pages
- Manage API keys (view, regenerate)
Experiment Management:
- View active, paused, and archived experiments
- Quick status changes (start, pause, archive)
- Reinstate archived experiments
Subscription & Billing
Stripe integration with full subscription management
Payment Processing:
- Powered by Stripe (secure, PCI compliant)
- Credit cards, debit cards, digital wallets
- Automatic billing on renewal
- Instant plan activation
Subscription Management:
- Cancel anytime (access until period end)
- Annual plan cancellations stop auto-renewal only (no prorated refunds)
- Reactivate canceled subscriptions
- View upcoming renewals and amounts
- Access payment history and invoices
Stripe Customer Portal:
- Update payment methods securely
- Download invoices and receipts
- View billing history
- Manage subscription details
Plan Changes:
- Upgrade instantly (prorated billing)
- Downgrade at period end
- Limits enforced immediately
Free Tier Branding
Powered by Segmently badge on free accounts
Badge Appearance:
- Bottom-right corner of client websites
- Segmently logo with "Powered by Segmently" text
- Links to segmently.us
- Small, non-intrusive design
Technical Implementation:
- Iframe isolation (prevents CSS/JS removal)
- MutationObserver reattaches if removed
- All styles use !important (no override)
- Only shown when subscription_tier === 'free'
Removal:
- Upgrade to Professional or higher
- Badge instantly removed from all sites
- Snippet automatically checks tier on load
Subscription Tiers & Limits
Free, Professional, Business, Enterprise plans, unlimited visitors on every tier
Free Tier ($0/mo):
- Unlimited visitors
- 1 experiment, 1 project, 1 team member
- 3 days data retention
- “Powered by Segmently” badge (required)
- Community support
Professional ($499/mo):
- Unlimited visitors
- 2 experiments, 1 project, 1 team member
- 7 days data retention
- Full analytics, funnel goals, Slack notifications
- No branding, priority support
Business ($1,499/mo):
- Unlimited visitors
- 3 experiments, 1 project, 2 team members
- 30 days data retention
- Advanced analytics, GA4/Mixpanel/webhook integrations, REST API
Enterprise ($9,999/mo):
- Unlimited visitors, experiments, projects, team members
- 1 year data retention
- Dedicated account manager, 99.99% SLA, custom webhook integrations
Limit Enforcement:
- “+ New Project” button disabled when at limit
- “+ New Experiment” button disabled when at limit
- “Invite Member” button disabled when at limit
- Upgrade prompts with tier-specific messaging
- Badge shows current usage (e.g., “1/1 Projects”)
- Experiment data is automatically purged after each tier's retention window
Security & Privacy
Enterprise-grade security and GDPR compliance
Authentication:
- JWT tokens with 30-day expiration
- Database validation on every request
- Auto-logout on account suspension/deletion
- Bcrypt password hashing (cost 10+)
Privacy:
- No cookies stored on visitor browsers
- No cross-site tracking
- GDPR compliant by design
- Full data ownership
API Security:
- API key validation on every event
- Rate limiting per IP address
- Input sanitization (XSS protection)
- Disabled accounts = disabled API keys instantly
URL Targeting
Precise control over where experiments run
Match Types:
Exact: https://example.com/pricing
Only matches this exact URL
Contains: /product/
Matches any URL with /product/ anywhere
Starts With: https://example.com/blog/
Matches all blog posts
Ends With: /checkout
Matches any checkout page
Regex: ^https://example\.com/product/[0-9]+$
Advanced pattern matching
Experiments only run on matching URLs - visitors won't be tracked elsewhere
Integrations
Connect Segmently to the tools your team already uses, so experiment data flows automatically into your analytics platform, Slack workspace, or custom systems.
Google Analytics 4 (GA4) Sync
Automatically forward experiment variant data into GA4 so you can segment any metric (revenue, sign-ups, scroll depth) by which variant each visitor saw
GA4 integration requires a Business plan or higher. Configure it inside each experiment under the Integrations tab.
What GA4 sync does
When a visitor is bucketed into a variant, the Segmently snippet fires a gtag('event', 'experiment_impression', …) call into your existing GA4 property, no extra tagging needed. You provide your Measurement ID once, and experiment data flows automatically into GA4 alongside all your existing events.
// Segmently fires this automatically on variant assignment
gtag('event', 'experiment_impression', {
experiment_id: 'hero-headline-test',
experiment_name: 'Hero Headline Test',
variant_id: 'abc123-...',
variant_name: 'Variant A'
});How data flows to GA4
window.gtag present on the page?Event parameter reference
| Parameter | Type | Example value | Notes |
|---|---|---|---|
experiment_id | string | hero-headline-test | URL-safe slug of your experiment |
experiment_name | string | Hero Headline Test | Human-readable experiment display name |
variant_id | string | abc123-... | UUID of the assigned variant |
variant_name | string | Variant A | Human-readable variant name (Control, Variant A, etc.) |
How it works (under the hood)
- Visitor loads your page; the Segmently snippet runs synchronously in
<head>. - Snippet checks for a
seg_visitor_idcookie → creates a UUID if absent. This ID persists across visits and sessions. - Snippet hashes
visitor_id + experiment_idto produce a stable bucket (0–99). Same visitor always gets the same variant. - If the bucket is within the experiment's traffic percentage, the visitor is assigned a weighted variant. Assignment is written to a persistent cookie for future visits.
- Visual changes (CSS, DOM, JS) for the assigned variant are applied before the page is revealed, zero flicker guaranteed.
- The snippet checks
window.gtag. If present, it immediately callsgtag('event', 'experiment_impression', …). - The event appears in GA4 under Reports → Realtime within seconds and in standard reports within 24–48 hours.
window.gtag is initialized before the Segmently snippet runs. Load gtag.js in <head> above the Segmently script tag. Standard GA4 installations do this automatically.Why connect experiments to GA4?
📊 Segment any GA4 metric by variant
Filter purchases, sign-ups, scroll depth, session duration (every metric GA4 tracks) by which variant was shown. Full business impact beyond a conversion rate.
🔀 Cross-channel attribution
A visitor bucketed Monday and converting Friday via email is still attributed to the correct variant in GA4's user-scoped session model.
💰 Revenue split by variant
On Shopify, WooCommerce, or GA4 Enhanced Ecommerce, see actual revenue per variant: "Variant B drove $4,200 vs $2,700 for Control over 30 days."
👥 Build audiences by variant
Create GA4 Audiences of users who saw a specific variant, then retarget them, exclude them from future tests, or personalize follow-up campaigns.
🗄️ BigQuery deep analysis
GA4-to-BigQuery exports land experiment_impression in raw event tables. Write SQL joining variant with LTV, revenue, or any custom business event.
📈 Dashboard blending
In Looker Studio, blend Segmently analytics with GA4 data on the shared experiment_name dimension for executive-ready dashboards.
Setup (4 steps)
- Go to your experiment → Integrations tab.
- Enter your GA4 Measurement ID (format:
G-XXXXXXXXXX).Find it: GA4 → Admin → Data Streams → your web stream → Measurement ID. - Save. The setting applies to all new visitor sessions immediately.
- Verify: GA4 → Reports → Realtime, load your page in a fresh incognito window, check for
experiment_impressionin the event list.
Register custom dimensions in GA4 (recommended)
Custom event parameters don't appear in standard GA4 reports automatically. Register them so experiment_name and variant_name are available as dimensions everywhere in GA4.
- GA4 → Admin → Custom definitions → Custom dimensions → Create custom dimension.
- Add all four:
experiment_name,variant_name,experiment_id,variant_id, each with Scope: Event and the matching parameter name. - Custom dimensions apply going forward only; they are not retroactively applied to past data.
Free GA4 supports up to 50 event-scoped custom dimensions. GA4 360 supports up to 125.
Build a variant comparison in GA4 Explore
- GA4 → Explore → create a new Free Form report.
- Dimensions: add
experiment_nameandvariant_name. - Metrics: add your key conversion event (e.g.
purchase,sign_up) or session/engagement metrics. - Drag
variant_nameinto the Columns slot for automatic side-by-side comparison. - Add a filter: Event name exactly matches experiment_impression to scope to experiment visitors only.
BigQuery: revenue by variant (SQL example)
If you export GA4 to BigQuery, this query breaks down revenue per variant. Replace the dataset and date range as needed.
SELECT
ep_variant.value.string_value AS variant_name,
COUNT(DISTINCT user_pseudo_id) AS unique_users,
ROUND(SUM(ep_revenue.value.double_value), 2) AS total_revenue,
ROUND(
SUM(ep_revenue.value.double_value) /
NULLIF(COUNT(DISTINCT user_pseudo_id), 0), 2
) AS revenue_per_user
FROM
`your_project.analytics_XXXXXXXX.events_*`
CROSS JOIN UNNEST(event_params) AS ep_variant
CROSS JOIN UNNEST(event_params) AS ep_revenue
WHERE
_TABLE_SUFFIX BETWEEN '20260101' AND '20260131'
AND ep_variant.key = 'variant_name'
AND ep_revenue.key = 'value'
AND EXISTS (
SELECT 1 FROM UNNEST(event_params) ep
WHERE ep.key = 'experiment_name'
AND ep.value.string_value = 'Hero Headline Test'
)
GROUP BY variant_name
ORDER BY total_revenue DESC;Slack Notifications
Get real-time alerts in Slack when experiments start, reach significance, or when team and billing events occur, at the org level or per experiment
Org-level Slack notifications and per-experiment Slack webhooks are available on the Professional plan and higher. Configure them separately; one governs your whole workspace, the other overrides a single experiment.
Two levels of Slack integration
Org-Level (Recommended)
- ✅ One webhook URL covers your entire workspace
- ✅ 15 event types: pick exactly what you want
- ✅ Covers experiments, projects, team, and billing
- ✅ Toggle each event type on/off independently
- ℹ️ Configure at Organization → Features & Integrations
Per-Experiment Override
- ✅ Different webhook per experiment (e.g. different Slack channel)
- ✅ Auto-fires on 4 core lifecycle events for that experiment
- ✅ Bypasses org-level preference checks; fires unconditionally
- ℹ️ Configure inside each experiment's Integrations tab
Org-level event types (15 total)
experiment.startedAn experiment is launched (status → active)experiment.pausedAn experiment is pausedexperiment.archivedAn experiment is archivedsignificance.reachedA variant first crosses 95% statistical confidenceexperiment.createdA new experiment is created (any status)experiment.deletedAn experiment is permanently deletedproject.createdA new project is createdproject.deletedA project is deletedmember.invitedA team invitation is sentmember.joinedAn invited member accepts and joinsmember.removedA member is removed from the teamteam.ownership_transferredOwnership is transferred to another membersubscription.upgradedThe org upgrades to a higher plansubscription.downgradedThe org downgrades to a lower planpayment.failedA Stripe payment attempt failsPer-experiment events (always fires when webhook URL set)
experiment.started: experiment goes liveexperiment.paused: experiment is pausedexperiment.archived: experiment is archivedsignificance.reached: a variant first hits 95% confidence (fires once per experiment lifetime)
The significance message includes the winning variant name, confidence level (e.g. 96.4%), and a direct link to the experiment results page in your dashboard.
How to create a Slack Incoming Webhook
Segmently uses Slack's standard Incoming Webhooks, a simple HTTP endpoint tied to a specific Slack channel. Here's how to create one:
- Go to api.slack.com/apps and click Create New App → From scratch.
- Name the app (e.g. "Segmently Alerts") and choose your Slack workspace.
- In the left sidebar, click Incoming Webhooks, then toggle "Activate Incoming Webhooks" to On.
- Click Add New Webhook to Workspace, choose the channel you want notifications delivered to (e.g.
#ab-testing-alerts), and click Allow. - Copy the Webhook URL; it looks like
https://hooks.slack.com/services/TXXXXXXXX/BXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX - Paste this URL into Segmently:
- Org-level: Organization → Features & Integrations → Slack Webhook URL
- Per-experiment: Experiment → Integrations tab → Slack Webhook URL
- Click Test Webhook in Segmently to verify a test message arrives in your Slack channel.
Example Slack messages
significance.reached
🏆 Segmently: Experiment hero-headline-test has a winner! Variant Variant B reached 96.4% confidence. View results →
experiment.started
▶️ Segmently: Experiment pricing-page-cta is now live.
payment.failed
⚠️ Segmently: A payment attempt failed for your subscription. Please update your payment method.
Tips & best practices
- Create a dedicated Slack channel like
#segmently-alertsto avoid noise in general channels. - Use different webhook URLs (different channels) for experiment events vs. billing events; you can mix one org-level URL for billing/team events and per-experiment URLs for experiment channels.
- The
significance.reachedevent fires exactly once per experiment; it will not re-trigger if confidence fluctuates below 95% and comes back up. - If you rotate your Slack app or delete the webhook, update the URL in Segmently immediately; stale webhook URLs cause silent delivery failures.
- Org-level notifications respect each toggle independently, so you can receive only the events that matter to your team. Visit Organization → Features & Integrations to fine-tune.
Outbound Webhooks
POST experiment events to any HTTPS endpoint and connect Segmently to your own systems, CRMs, or CI/CD pipelines
Outbound webhooks require an Enterprise plan. Configure per experiment under the Integrations tab.
Enter any HTTPS endpoint and Segmently will POST a JSON payload whenever the selected event fires for that experiment. Useful for updating a CRM record, logging results to an internal dashboard, triggering a CI/CD step, or sending data to a custom data warehouse.
Subscribed events (per experiment)
experiment.startedexperiment.pausedsignificance.reached
Example payload
{
"event": "significance.reached",
"experiment_id": "exp_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"experiment_name": "hero-headline-test",
"variant_id": "var_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"variant_name": "Variant B",
"confidence": 0.964,
"timestamp": "2026-03-02T14:23:00Z"
}- The endpoint must respond with a
2xxstatus code within 10 seconds. - Segmently makes one delivery attempt; there is no automatic retry on failure.
- Use a service like webhook.site to inspect payloads during testing.
Mixpanel Integration
Stream experiment impressions into Mixpanel as first-class events, enabling variant-level funnel analysis, cohort retention, and user-level behavioral breakdowns
Mixpanel integration requires a Business plan or higher. Configure it inside each experiment under the Integrations tab.
What Mixpanel integration does
When a visitor is bucketed into an experiment variant, the Segmently snippet calls mixpanel.track('$experiment_started', …) , Mixpanel's standard A/B testing event name, with your experiment and variant details as properties. Because Mixpanel is user-centric (not session-centric like GA4), this event gets attached to the same Mixpanel user profile your site already tracks. You can then break any downstream Mixpanel event (purchases, feature activations, retention milestones) by which experiment variant that user was assigned to.
// Segmently fires this automatically on variant assignment
mixpanel.track('$experiment_started', {
'Experiment name': 'Hero Headline Test',
'Experiment ID': 'hero-headline-test',
'Variant name': 'Variant A',
'Variant ID': 'abc123-...'
});The event name $experiment_started uses Mixpanel's reserved prefix ($) for A/B testing events; this makes it compatible with Mixpanel's built-in A/B testing reports and experiments UI if you use Mixpanel Experiments.
How data flows to Mixpanel
window.mixpanel present?GA4 vs Mixpanel: Which Integration Should You Use?
| Capability | GA4 | Mixpanel |
|---|---|---|
| Data model | Session-based | User / event-based |
| Funnel analysis | ✅ (Explore) | ✅ Best-in-class |
| Cohort retention | ⚠️ Limited | ✅ Purpose-built |
| User-level query | ⚠️ Via BigQuery only | ✅ Built into UI |
| Revenue tracking | ✅ Enhanced Ecommerce | ✅ Custom revenue property |
| Free tier | ✅ Unlimited hits | ✅ 20M events/mo free |
| Best for | SEO, ads, revenue, blending | Product analytics, retention, activation |
You can enable both GA4 and Mixpanel for the same experiment; they operate independently and complement each other.
Event property reference
| Property name | Type | Example value | Notes |
|---|---|---|---|
Experiment name | string | Hero Headline Test | Human-readable display name |
Experiment ID | string | hero-headline-test | URL-safe slug of the experiment |
Variant name | string | Variant A | Human-readable variant name (Control, Variant A, etc.) |
Variant ID | string | abc123-... | UUID of the assigned variant |
How it works (under the hood)
- Visitor loads your page; Segmently snippet runs synchronously in
<head>. - Snippet checks for a
seg_visitor_idcookie → creates a UUID if absent. - Variant is assigned by hashing
visitor_id + experiment_idto produce a stable 0–99 bucket. Same visitor always receives the same variant. - Visual changes are applied before the page is revealed (anti-flicker CSS removed only after changes are in place).
- The snippet checks
window.mixpanel. If the Mixpanel JS SDK is initialized, it callsmixpanel.track('$experiment_started', …). - Mixpanel attaches the event to the identified Mixpanel user (if
mixpanel.identify()has been called) or to the anonymousdistinct_idfor that visitor. - This means variant assignment is tied to a Mixpanel user profile; any future conversion event on that profile can be broken down by
Variant name.
window.mixpanel must be initialized before the Segmently snippet runs. Load the Mixpanel JS SDK in <head> above the Segmently script tag and call mixpanel.init('YOUR_TOKEN') before any page logic.What Mixpanel unlocks for your experiments
🔢 User-level variant breakdown
Mixpanel is user-centric; every downstream event from a user is linked to their experiment assignment. Filter any insight by variant without writing SQL.
🌊 Funnel analysis by variant
Build a funnel (Sign Up → Onboard → Activate → Pay) and instantly compare completion rates between Control and Variant A. Mixpanel shows drop-off at each step per variant.
🔄 Retention by variant
See "did users who saw Variant B return on Day 7 at a higher rate than Control?" Mixpanel Retention charts make this a 5-minute analysis.
🎯 Cohort building
Create a cohort of all users who received "Variant A" in "Hero Headline Test", then run any Mixpanel analysis scoped to only that cohort across any time period.
⚡️ Real-time event stream
Mixpanel's Live View shows each $experiment_started event as it fires, including all experiment properties, for instant verification after saving the integration.
📊 Segmentation in any report
Add "Variant name" as a breakdown dimension in any Mixpanel Insights chart (bar charts, line charts, pie charts) to compare variant performance on any metric.
Setup (4 steps)
- Go to your experiment → Integrations tab.
- Enter your Mixpanel Project Token.Find it: Mixpanel → Settings (⚙️ top-right) → Project settings → Project token.
- Save. The setting applies to all new visitor sessions immediately.
- Verify: Mixpanel → Activity Feed or Live View, load your page, and watch for a
$experiment_startedevent appearing in real-time.
Registering variant as a Super Property (optional, recommended)
Super Properties in Mixpanel are key-value pairs that are automatically attached to every future eventthe user fires during that session. Registering the assigned variant as a Super Property means you don't need to filter by $experiment_started first; every downstream event already carries the variant information.
// Add this after your Segmently snippet if you want variant
// attached to every subsequent Mixpanel event automatically.
// window.Segmently.getVariant() returns the variant key for
// the first active experiment, or null if unassigned.
const variant = window.Segmently?.getVariant?.('hero-headline-test');
if (variant) {
mixpanel.register({
'AB Test: Hero Headline': variant // e.g. 'control', 'variant_a'
});
}Super Properties persist in the user's browser until mixpanel.unregister() is called. Use descriptive property names (e.g. 'AB Test: Hero Headline') to avoid collisions across multiple experiments.
Build a funnel comparison in Mixpanel
- Mixpanel → Funnels → create a new funnel.
- Step 1: Event =
$experiment_started. Add filter: Experiment name = Hero Headline Test. - Add subsequent steps: your key conversion events (e.g.
sign_up,checkout_completed). - Click Breakdown → select
Variant name. - Mixpanel will render each variant as a separate bar in the funnel, showing conversion rate at each step per variant.
Create a variant cohort in Mixpanel
- Mixpanel → Cohorts → Create cohort.
- Condition: User did event
$experiment_startedwhere Variant name = Variant A. - Save the cohort (e.g. “Hero Test: Variant A”).
- Use this cohort as a filter in any Mixpanel Insights, Retention, or Funnel report; instantly scoping that report to only users who saw Variant A.
- Create matching cohorts for Control and any other variants to compare them side-by-side.
Retention analysis by variant
- Mixpanel → Retention → create a new retention report.
- Birth event:
$experiment_started(filtered to your experiment name). - Return event: your key engagement/activation event (e.g.
session_started,feature_used). - Click Breakdown →
Variant name. - Mixpanel shows Day 1, Day 7, Day 14, Day 30 retention curves for each variant, revealing which variant drives longer-term engagement, not just first-session conversion.
Technical Reference
JavaScript API
Programmatic integration from your website code
Core Object:
window.SegmentlyAvailable Methods:
// 1) Track custom events
window.Segmently.track('cta_click', {
section: 'hero',
label: 'start_free_trial'
});
// 2) Get assigned variant for an experiment
const variant = window.Segmently.getVariant('homepage-hero-test');
// 3) Get stable anonymous visitor ID
const visitorId = window.Segmently.getVisitorId();
// 4) Attach custom attributes to the current visitor
window.Segmently.setAttributes({
plan: 'pro',
country: 'US'
});
// 5) Get all active experiment-to-variant assignments
const assignments = window.Segmently.getAllAssignments();
// Returns: { 'homepage-hero': 'variant_a', 'pricing-test': 'control' }
// 6) Clear visitor identity and all experiment state
window.Segmently.reset(); // Call on logoutMethod Behavior:
- track(eventName, eventData?) sends custom analytics events to Segmently
- getVariant(experimentSlug) returns the assigned variant key or null
- getVisitorId() returns the persistent anonymous visitor ID
- setAttributes(attrs) merges custom key-value pairs onto the visitor profile for targeting and event metadata
- getAllAssignments() returns a plain object mapping every active experiment slug to the visitor's assigned variant key
- reset() clears visitor identity, all experiment assignments, and custom attributes then generates a fresh visitor ID — call on logout
- Methods are available after the snippet initializes on the page
Recommended Pattern:
function safeTrack(eventName, data) {
if (window.Segmently && typeof window.Segmently.track === 'function') {
window.Segmently.track(eventName, data)
}
}REST API Reference
Programmatic endpoints for assignment and tracking
Public API Base URL:
https://segmently.us/api/v1Always use segmently.us in client integrations. Do not expose internal infrastructure URLs.
Authentication Header:
X-API-Key: seg_live_xxxxxAssign Visitor to Variant:
POST /api/v1/experiments/:experimentSlug/assign
Content-Type: application/json
X-API-Key: seg_live_xxxxx
{
"visitor_id": "visitor_123",
"targeting_data": {
"url": "https://example.com/pricing",
"device": "desktop"
}
}Track Event:
POST /api/v1/events/track
Content-Type: application/json
X-API-Key: seg_live_xxxxx
{
"event_name": "conversion",
"visitor_id": "visitor_123",
"session_id": "session_abc",
"experiment_id": "exp_123",
"variant_id": "var_123",
"event_data": { "value": 99.99 },
"device_type": "desktop"
}Batch Events:
POST /api/v1/events/batch
Content-Type: application/json
X-API-Key: seg_live_xxxxx
{
"events": [
{
"event_name": "scroll_depth",
"visitor_id": "visitor_123",
"event_data": { "percent": 75 }
},
{
"event_name": "cta_click",
"visitor_id": "visitor_123",
"event_data": { "location": "hero" }
}
]
}Management API (Enterprise)
Automate experiment control and receive real-time event notifications from your own backend
Management API Keys
Generate long-lived seg_mgmt_* API keys from Settings → API. Use them to authenticate against the Management REST API without exposing your dashboard login credentials.
- Keys are stored server-side as SHA-256 hashes — the raw key is shown exactly once at creation. Copy it immediately.
- Up to 10 active management keys per organization
- Keys can be revoked at any time from Settings. Revocation takes effect on the next request.
- Enterprise plan required. Only organization owners can create or revoke keys.
Authentication:
# Pass in Authorization header
Authorization: Bearer seg_mgmt_<your-key>
# Or via X-Management-Key header
X-Management-Key: seg_mgmt_<your-key>REST Management Endpoints
All management endpoints are under /api/v1/manage/ and require a valid management key.
# List all projects
GET /api/v1/manage/projects
# List experiments (optional filter by project)
GET /api/v1/manage/experiments?project_id=<id>
# Get experiment details (full config, visual changes, goals)
GET /api/v1/manage/experiments/:id
# Update experiment status or traffic percentage
PATCH /api/v1/manage/experiments/:id
Content-Type: application/json
{
"status": "active", // draft | active | paused | archived
"traffic_percentage": 50 // 0–100
}Outbound Webhook Endpoints
Subscribe to Segmently events and receive real-time HTTP POST notifications at your own HTTPS endpoint. Configure from Settings → API.
- Up to 20 active webhook endpoints per organization
- HTTPS-only. Private/internal IP addresses are rejected at creation time.
- Every delivery includes an
X-Segmently-Signature: sha256=<hex>header. Verify it on your server to confirm the payload is authentic. - Use the Test button in Settings to send a sample payload and confirm your endpoint is reachable.
Supported event types:
experiment.started experiment.paused experiment.archived
experiment.created experiment.deleted significance.reached
project.created project.deleted
member.invited member.joined member.removed
team.ownership_transferred
subscription.upgraded subscription.downgraded payment.failedPayload format:
{
"event": "experiment.started",
"team_id": "<uuid>",
"timestamp": "2026-03-12T10:00:00Z",
"data": { ... } // event-specific fields
}Signature verification (Node.js example):
const crypto = require('crypto');
function verifySignature(rawBody, secret, signatureHeader) {
const expected = 'sha256=' +
crypto.createHmac('sha256', secret)
.update(rawBody)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(expected),
Buffer.from(signatureHeader)
);
}Snippet Verification & QA Playbook
How clients verify project setup, experiments, and tracking end-to-end
1) Install and verify snippet load
<script src="https://segmently.us/segmently.js"
data-api-key="seg_live_xxxxx"></script>- Place in <head> or before </body>
- Open browser console and confirm no snippet initialization errors
- Confirm requests are sent to
segmently.us/api/v1
2) Verify project linkage
- Ensure the API key belongs to the correct project in Dashboard
- Confirm target URL in project settings matches client site domain
- Use API key regeneration if a compromised key is suspected
3) Verify experiment eligibility
- Status must be active/live (not draft)
- URL targeting, device targeting, and geo targeting must match current visitor context
- Traffic percentage must include enough visitors for validation
4) Verify visual changes and anti-flicker behavior
- Use preview links to inspect exact variant rendering
- Validate activation delay timing (0ms / 100ms / 500ms / custom)
- Check that bucketed users only see final variant state (no flash of original)
5) Verify analytics and events
- Confirm page_view and custom events appear in analytics
- Trigger
window.Segmently.track(...)and verify payload capture - Cross-check visitors, conversions, and variant distribution in experiment analytics
6) Verify tier-based behavior
- Free tier should display Powered by Segmently badge on client site
- Paid tiers should not render free-tier branding
Recommended client QA checklist before launch
- Snippet loads successfully on all key pages
- Experiment assignment works on desktop + mobile
- Variant visuals are stable with no flicker
- Events and conversions are visible in dashboard analytics
- API key, targeting rules, and traffic settings are correct
How It Works
Technical architecture and methodology
1. Snippet Loading:
- 9.4kb compressed JavaScript file
- Served from Vercel Edge Network globally
- Loads asynchronously (no page blocking)
2. Visitor Assignment:
- Deterministic hashing: hash(visitor_id + experiment_id)
- Consistent assignment across sessions (no cookies needed)
- Traffic percentage enforced at assignment time
- URL targeting validated before assignment
3. Event Tracking:
- Batched requests (reduces server load)
- Stored in PostgreSQL with timestamps
- JSONB metadata for extensibility
4. Statistical Analysis:
- Bayesian approximation for significance
- 95% confidence threshold for winner determination
- Real-time updates (no batch processing delays)
Current Features (March 2026)
What's available now in Segmently
- ✅ User account management with full authentication
- ✅ Project creation and management
- ✅ Experiment lifecycle controls (start, pause, resume, archive, reinstate)
- ✅ Real-time analytics dashboard with statistical significance
- ✅ Event tracking implementation (page views, conversions, bounces)
- ✅ Visual editor (snippet-based element selection)
- ✅ Anti-flicker protection with customizable activation delays
- ✅ Settings tabs (Profile, Security, Team, Notifications, Billing)
- ✅ Team management (roles, status, ownership transfer)
- ✅ Stripe billing integration (subscriptions, cancellation, portal)
- ✅ Free tier branding (removable by upgrading)
- ✅ Subscription tier enforcement (projects, experiments, team limits)
- ✅ API key management and regeneration
- ✅ Secure authentication with real-time validation
- ✅ Account status & suspension management
- ✅ Edge-native CDN delivery (<20ms globally)
- ✅ Privacy-first tracking (no cookies required)
- ✅ Device targeting (desktop, mobile, tablet)
- ✅ URL targeting (exact, contains, starts with, ends with, regex)
- ✅ Traffic percentage control
- ✅ Pre-push verification (git hooks, npm run verify)
- ✅ Management API keys (
seg_mgmt_*) for backend automation (Enterprise) - ✅ REST Management API — list projects, experiments, and update status programmatically (Enterprise)
- ✅ Outbound webhook endpoints with HMAC-SHA256 signed delivery — 15 event types (Enterprise)
- ✅ JavaScript SDK:
setAttributes(),getAllAssignments(),reset()
Security & Privacy
How we protect your data and your users
Authentication:
- JWT tokens with 30-day expiration
- Database validation on EVERY request (not cached)
- Checks: user exists, account active, permissions current
- Auto-logout on 401/403/404 responses
- Bcrypt password hashing (cost 10+)
API Key Validation:
- Every event validates account status in real-time
- Suspended/deleted accounts = instantly disabled API keys
- Rate limiting per IP address (prevents abuse)
- Input sanitization (XSS protection with html.EscapeString)
Privacy:
- GDPR Compliant by design
- No cookies stored on visitor browsers
- No cross-site tracking
- Full data ownership (you control everything)
- Visitor IDs are anonymous hashes
Database Security:
- Parameterized queries ($1, $2 placeholders)
- Never concatenate user input into SQL
- SQL injection pattern detection
- PostgreSQL on Neon (encrypted at rest)
Team Management Features
Collaborate with roles, permissions, and full control
Available Features:
- View all team members with real data (name, email, role, status)
- Role badges: Owner (blue), Admin (purple), Member (gray)
- Status badges: Active (green), Suspended (red)
- Three-dot menu for owner actions (on other members)
- Transfer Ownership → Make another member the owner
- Suspend/Activate → Toggle member account access
- Remove Member → Delete from team permanently
- Seat count display (e.g., "2/2 seats")
- Upgrade prompts when at team limit
Team Limits Enforced:
- Free: 1 member (owner only)
- Professional: 1 member
- Business: 2 members
- Enterprise: Unlimited
Coming Soon:
- Invite team members by email (requires email service)
- Per-project permissions (limit member access)
- Activity audit logs (who changed what, when)
- Custom roles with granular permissions
API Reference
Integrate Segmently into your application
POST /api/v1/events/trackX-API-Key: seg_live_xxxxxFull API documentation coming soon
Best Practices
Get the most out of your A/B tests
Experiment Design:
- Test one variable at a time (headline OR button color, not both)
- Start with high-impact changes (not minor tweaks)
- Make changes big enough to matter
Sample Size:
- Wait for at least 100 conversions per variant
- Never end test before 95% confidence
- Run for minimum 1 week (capture day-of-week patterns)
Success Metrics:
- Define primary metric before starting (conversion rate, revenue, etc.)
- Watch for secondary impacts (bounce rate, time on page)
- Consider long-term vs short-term effects
Documentation:
- Record hypothesis: "We believe changing X will increase Y because Z"
- Note start/end dates and traffic volume
- Document learnings even if test fails
- Share results with team
Support & Help
Troubleshooting
Common issues and solutions
Snippet Not Loading:
- Verify snippet in <head> or before </body>
- Check API key matches your project
- Look for console errors in browser DevTools
- Ensure no ad blockers blocking Segmently
Visitors Not Tracked:
- Check URL matches experiment targeting rules
- Verify experiment status is "Live" not "Draft"
- Check traffic percentage (if 10%, only 10% are tracked)
- Look for API errors in browser console
Visual Editor Not Working:
- Snippet must be installed on website
- Look for "Segmently snippet ready" message
- Check for CORS or security policy blocking iframe
- Try refreshing the page in visual editor
API Key Issues:
- Ensure using API key from correct project
- Check account status (suspended = disabled keys)
- Regenerate key if compromised
Getting Help
Contact support and community resources
Support Channels:
- Support Form - Submit detailed questions
- support@segmently.us - Direct email support
- Dashboard → Support - Quick access from app
Response Times:
- Free: 48 hours
- Professional/Business: 24 hours
- Enterprise: 4 hours (priority queue)
Self-Service:
- Complete documentation (this page)
- Installation guides for all platforms
- FAQ section with common questions
- Updates page with changelog
Need Additional Help?
Can't find what you're looking for? Our support team is ready to assist you.