Use this file to discover all available pages before exploring further.
The Winning Variant Native App allows users to manage experimentation resources directly inside of Snowflake by use of stored procedures created during installation.
USE <application_name>;-- Create a new lab with id `marketing`CALL experimentation.apply_resource($$schemaVersion: 1kind: labmetadata: id: marketing status: active name: Marketing description: All marketing and top-of-funnel experiments.$$);-- Update the name of the lab we just createdCALL experimentation.apply_resource($$schemaVersion: 1kind: labmetadata: id: marketing status: active name: Marketing Organization description: All marketing and top-of-funnel experiments.$$);
In addition to the above methods using raw YAML, you may also create/manage experiments with the following purpose-built convenience methods.All methods also have a *_preview variant is available that returns the YAML that would be applied without actually creating the experiment:
Returns: Table with columns operation, kind, id, name, status, description.
CALL experimentation.create_experiment( 'homepage-cta-test', 'Homepage CTA Test', 'Testing button color on homepage', NULL, 'A green CTA will increase conversions by 10%', 'USER', '[{"id":"control","name":"Blue Button","isControl":true},{"id":"green","name":"Green Button","isControl":false}]', '[{"variant":"control","split":0.5},{"variant":"green","split":0.5}]');
Adds one or more new variants to an existing experiment. Variant IDs must not conflict with existing variants. At most 1 control variant is allowed across all variants on the experiment.
Parameter
Description
Data Type
Example
experiment_id
ID of the experiment to add variants to. Must exist.
VARCHAR
'homepage-cta-test'
variants
JSON array of variant objects. Each must have id, name, and isControl. Optional description.
Adds a new cohort to an existing experiment. The cohort index is automatically assigned as the next sequential value. The experiment must already have variants defined.
Parameter
Description
Data Type
Example
experiment_id
ID of the experiment. Must exist and have variants defined.
VARCHAR
'homepage-cta-test'
cohort_variants
JSON array of cohort entries. Each must have variant (must be an existing variant on the experiment) and split (0.001–1.0). Splits must sum to 1.0. At most 1 control variant.
Updates one or more properties of an existing experiment. Pass NULL for any field that should not change. At least one field must be provided.
Parameter
Description
Data Type
Example
experiment_id
ID of the experiment. Must exist.
VARCHAR
'homepage-cta-test'
name
New name. Pass NULL to keep current.
VARCHAR
'Updated CTA Test'
description
New description. Pass NULL to keep current.
VARCHAR
'Revised experiment description'
status
New status. Must be one of: active, archived, draft, ended, winner_declared. Pass NULL to keep current.
VARCHAR
'ended'
hypothesis
New hypothesis. Pass NULL to keep current.
VARCHAR
'Updated hypothesis'
ended_reason
Reason the experiment ended. Only valid when status is ended. Must be one of: no_longer_needed, no_stat_sig, other_reason, success, tech_issue.
VARCHAR
'success'
winning_variant
ID of the winning variant. Only valid when status is winner_declared. Must be a variant on the experiment.
VARCHAR
'green'
Returns: Table with columns operation, kind, id, name, status, description.
-- Update just the name and hypothesisCALL experimentation.update_experiment( 'homepage-cta-test', 'New Name', NULL, NULL, 'New hypothesis', NULL, NULL);-- Declare a winnerCALL experimentation.update_experiment( 'homepage-cta-test', NULL, NULL, 'winner_declared', NULL, NULL, 'green');-- End an experiment with a reasonCALL experimentation.update_experiment( 'homepage-cta-test', NULL, NULL, 'ended', NULL, 'no_stat_sig', NULL);
Given experiment YAML, returns a markdown-formatted description of the experiment including metadata, variants, and cohort details.
Parameter
Description
Data Type
Example
yaml
Full experiment YAML string.
VARCHAR
(output from get_resource_yaml)
Returns: Table with a single markdown column containing the formatted description.
-- First get the YAML, then describe itCALL experimentation.get_resource_yaml('EXPERIMENT', 'homepage-cta-test');-- Use the YAML output as input:CALL experimentation.describe_experiment_yaml('<yaml string from above>');