- Optimizely Feature Experimentation
- Optimizely Full Stack (Legacy)
- Optimizely Web Experimentation
- Optimizely Performance Edge
When you test, it can be useful to start an experiment or campaign live on your site but allow only internal employees to see it.
Setting a test cookie lets you show a running campaign or experiment to a set of internal stakeholders. You create a bookmarklet in the browser that sets the cookie, then use audience conditions to target the cookie. Visitors who have the test cookie can go across multiple pages, and fire events in the live experiment or campaign.
In Optimizely Web Experimentation Testing, the test cookie is a key tool in the Pre-Launch Checklist for testing.
In Optimizely Web Personalization, the test cookie lets you share running campaigns. Use the Preview tool to check that your campaign looks and works the way you would like before you publish. Then, use the test cookie to share the live campaign with internal holders for testing.
Set a test cookie
You will set the test cookie in every browser used to QA with this method.
- Open a Chrome browser and create a bookmark on any page.
- Click the bookmark to change the name to Set a test cookie. Select Done to confirm.
- In the Chrome toolbar, select Bookmarks > Bookmark Manager. Click to edit the bookmark.
Go to the page of your site where you would like to set the test cookie.
- Select the bookmark to create a test cookie.
You now have a cookie set on whichever domain you are browsing. The cookie will look something like this:
When you reload the page, you can enter an experiment or campaigns that target that cookie.
Target the test cookie
After you set your test cookie, use an audience condition to target it. Only visitors who have the test cookie will be eligible to enter the experiment or campaign.
- Go to the Experiments dashboard and choose the experiment or campaign.
- In the Manage Experiments sidebar, click Audiences.
- Click Create New Audience.
- Select Standard > Cookie and drag it into the conditions.
- Enter a name for the audience.
- Enter the name of the test cookie,
optly_YOURDOMAINNAME_testin the text box and set to has any value.
- Click Save Audience.
Target a query parameter
If your Optimizely Web Experimentation plan does not include targeting by cookie, you can use a query parameter instead. This also works well when testing your experiment on a mobile device.
When you view your page live, append the query parameter that you selected. For instance, on Google's homepage, this may look like
https://www.google.com?optly_google_test if you use the query parameter shown in the following image:
When you are done, click Apply and then save the experiment.
Run the experiment or campaign
After you set the test cookie, start the experiment or campaign to view it live.
To see the experiment or campaign, you still need to meet all of the targeting conditions, but when you are bucketed into a variation or experience, you can navigate the site and stay in that variation. You can also test whether your goals are firing correctly.
Remove the test cookie
To make the experiment live for other visitors, return to targeting. Remove the cookie restriction by clicking Cancel (red X) next to it. Click Apply to save the change to the experiment.