Create & clone experiences
Create & clone experiences
This is for:Developer
In this article, we’ll show you how to create and upload experiences with
Running your first experience
Create a directory:
$ mkdir demo $ cd demo
Create a new experience:
$ qubit create
The output from the create command should tell you the name of the folder that was created cd into that folder and run your local experience server by calling qubit with the name of your variation file:
$ qubit variation-1234.js
Alternatively, running just
qubit will automatically select your most recently created variation:
Open Chrome and select the Chrome extension icon.
The page background should turn yellow.
Change the background declaration in
variation.css to green.
The page background should update on the fly.
Creating a new experience
You can create a new experience by executing
If you have access to more than one property, you can select the property you want to create the experience for. You can also pass in your property Id.
$ qubit create $ qubit create 2499
You can pass in additional parameters when creating experiences, bypassing prompts, to further integrate into your CI/CD pipeline. The following parameters can be used:
property Id- the property in which to create the experience
experience name- the name of the experience
traffic split- ratio of traffic to route into control as a decimal value (for example,
1for all traffic)
template Id- optionally, the template to base the experience on
In the following example, the user is creating an experience called
myExperience, for the property
2499, with a 50/50 traffic split:
$ qubit create 2499 myExperience 0.5
If you need to specify an existing template you can pass in the template Id as well.
In the following example this is
$ qubit create 2499 myExperience 0.5 196961
Cloning existing experiences
qubit clone command allows you to copy down all the files from an existing experience so that you can work on it locally.
If you have access to more than one property, you’ll be able to select the property you want to clone the experience from and then you’ll be able to search for that experience using the terminal prompt.
You can also navigate to the experience in your browser, since the
Qubit CLI extension will detect which experience you’re working on and ask if you would like to clone that one.
Finally, if you know the Ids or have the URL to hand, you can simply paste these in as an argument and
Qubit CLI will understand which experience you wish to clone.
For example, if you know the experience Id:
$ qubit clone $ qubit clone 2499 1234 $ qubit clone https://app.qubit.com/p/2499/experiences/1234