Skip to main content

Experiments

Experiments let you test different image variants to optimize performance. Pictify supports three experiment types: A/B tests for statistical comparison, smart links for context-based routing, and scheduled variants for time-based switching.

Experiment Types

A/B Tests

Split traffic between variants to determine which performs best. Pictify uses Thompson Sampling (multi-armed bandit) to automatically optimize traffic allocation toward winning variants. Route users to different image variants based on context: device type, geographic location, time of day, or custom rules. Smart links use nested condition trees with AND/OR logic.

Scheduled Variants

Switch between image variants on a schedule. Supports one-time switches, daily/weekly recurrence, and cron expressions for complex schedules.

Experiment Lifecycle

Experiments follow a strict state machine:
Invalid state transitions return a 409 Conflict error with the current status and allowed transitions.

Variants

Each experiment has 2 or more variants. Every variant can reference a different template and set of variables.

Weights

Variant weights use basis points (hundredths of a percent). All variant weights must sum to exactly 10,000.
Smart link variants use condition trees with nested AND/OR logic (max depth: 3 levels):

Scheduled Variants

Scheduled variants activate based on time:
Recurrence types: none, daily, weekly, cron.

Rendering Experiments

Experiment images are served via public URLs:
The server automatically selects a variant based on the experiment type:
  • A/B tests: Thompson Sampling or equal split
  • Smart links: First matching condition
  • Scheduled: Currently active schedule

Embedding

Event Tracking

Track impressions, views, clicks, and conversions to measure experiment performance.
Events can be sent individually or in batches (up to 100 per request).

Click Tracking

Redirect users through a tracked link:

Tracking Pixel

Embed an invisible tracking pixel for email open tracking:

Goal Configuration

For click-through goals, set a destinationUrl where users are redirected after clicking:

Auto-Optimization

A/B tests can use Thompson Sampling to automatically shift traffic toward winning variants:
Auto-optimization requires the Standard plan or above.

Plan Limits

Check your current quota:

Security Considerations

Write Key vs API Token: Your API token (pk_live_...) is a secret and must never be exposed client-side. The write key is designed for client-side event tracking and is safe to include in browser code.
  • Experiment slugs are public identifiers visible in URLs. Do not embed sensitive information in slug names.
  • Use a write key for event tracking. Without it, anyone who knows your experiment slug can inject events and corrupt your test data.
  • Validate destination URLs for click-through experiments to prevent open redirect abuse.

Best Practices

  1. Run experiments for at least 7 days to account for day-of-week traffic variations
  2. Set a minimum sample size before drawing conclusions (default: 1,000 impressions)
  3. Use auto-optimization for low-traffic experiments where you want to minimize opportunity cost
  4. Track all event types (impression + click) for complete funnel analysis
  5. Use slugs that describe the test, not the expected outcome (e.g., homepage-hero-test, not new-design-winner)