<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Robert Kingston</title>
    <description>The latest articles on DEV Community by Robert Kingston (@kingo55).</description>
    <link>https://dev.to/kingo55</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F243555%2Fbae5d626-fb26-4b67-a85d-d4f252255ddf.jpeg</url>
      <title>DEV Community: Robert Kingston</title>
      <link>https://dev.to/kingo55</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kingo55"/>
    <language>en</language>
    <item>
      <title>Avoiding Optimizely impressions to save time &amp; run better tests</title>
      <dc:creator>Robert Kingston</dc:creator>
      <pubDate>Mon, 13 Jul 2020 08:19:13 +0000</pubDate>
      <link>https://dev.to/kingo55/avoiding-optimizely-impressions-to-save-time-run-better-tests-1d2</link>
      <guid>https://dev.to/kingo55/avoiding-optimizely-impressions-to-save-time-run-better-tests-1d2</guid>
      <description>&lt;p&gt;I recently posted some methods for &lt;a href="https://mintmetrics.io/experiments/bypass-optimizely-impressions-save-money/"&gt;setting up experiments without Optimizely impression tracking&lt;/a&gt;. For all the juicy details, you may like to read that post, but I'll share the gist of it below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Disclaimers
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;If you're using this specifically to avoid impression counting, then please be aware this can violate Optimizely's terms of service and/or your contract.&lt;/li&gt;
&lt;li&gt;If you rely on Optimizely's reports for deciding winning variants, then this also isn't for you.&lt;/li&gt;
&lt;li&gt;Triggers run on all pages, so be sure you know what you're doing before you publish any JavaScript.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;With that out of the way, here's how we typically setup zero-impression tests in Optimizely:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Add an open source split testing library to your shared code
&lt;/h3&gt;

&lt;p&gt;Got to your Optimizely account and open "Settings" and then "JavaScript".&lt;/p&gt;

&lt;p&gt;Next, paste in an open source split testing tool (in this example, we'll be using &lt;a href="https://mojito.mx/"&gt;Mojito&lt;/a&gt;, because it's a tool we maintain and are familiar with). But any open source split testing library will do.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M9jf9AjK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://mintmetrics.io/wp-content/uploads/2020/07/mojito_in_optimizely-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M9jf9AjK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://mintmetrics.io/wp-content/uploads/2020/07/mojito_in_optimizely-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Create an A/B split test
&lt;/h3&gt;

&lt;p&gt;From the "Experiments" tab, create a new A/B split test. Give it a name and URL for your preview links (anything will do here, because you won't be using Optimizely for the tracking)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v3k8634t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://mintmetrics.io/wp-content/uploads/2020/07/optimizely_create_experiment-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v3k8634t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://mintmetrics.io/wp-content/uploads/2020/07/optimizely_create_experiment-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Set your page targeting to a "callback trigger"
&lt;/h3&gt;

&lt;p&gt;Under "Page targeting", you'll need to set your trigger to "Use a callback function".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UgJrjAFx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://mintmetrics.io/wp-content/uploads/2020/07/select_optimizely_trigger_type-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UgJrjAFx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://mintmetrics.io/wp-content/uploads/2020/07/select_optimizely_trigger_type-1.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Paste your split test code all within the trigger
&lt;/h3&gt;

&lt;p&gt;Now it's time to add you other split test code. Following from the example above, we'll use a &lt;a href="https://mojito.mx/docs/js-delivery-setup-js"&gt;Mojito A/B test&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If your experiment code looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mojito.addTest({
    "state": "live",
    "sampleRate": 0.5,
    "id": "ex1",
    "name": "ex1 scaffold",
    "recipes": {
        "0": {
            "name": "Control"
        },
        "1": {
            "name": "Treatment",
            "js": function treatment(test) {
                console.log('Test id: ' + test.options.id, ', name: ' + test.options.name, ', chosen recipe: ' + test.chosenRecipe.id);
            }
        }
    },
    "trigger": function trigger(test) {
        Mojito.utils.domReady(test.activate);
    }
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Then you simply need to wrap it inside the trigger callback function, like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function trigger (activate, options) {
    Mojito.addTest({
        "state": "live",
        "sampleRate": 0.5,
        "id": "ex1",
        "name": "ex1 scaffold",
        "recipes": {
            "0": {
                "name": "Control"
            },
            "1": {
                "name": "Treatment",
                "js": function treatment(test) {
                    console.log('Test id: ' + test.options.id, ', name: ' + test.options.name, ', chosen recipe: ' + test.chosenRecipe.id);
                }
            }
        },
        "trigger": function trigger(test) {
            Mojito.utils.domReady(test.activate);
        }
    });
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Once that's done, you can save it. Now you're right to launch your zero-impressions experiment.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Starting/Stopping your experiment
&lt;/h3&gt;

&lt;p&gt;As with any Optimizely experiment, you can start it or stop it as you normally would.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--02AwkxKb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://mintmetrics.io/wp-content/uploads/2020/07/pause_optimizely_experiment.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--02AwkxKb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://mintmetrics.io/wp-content/uploads/2020/07/pause_optimizely_experiment.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  That's it in a nutshell
&lt;/h2&gt;

&lt;p&gt;How do others implement experiments in Optimizely?&lt;/p&gt;

</description>
      <category>optimizely</category>
      <category>splittesting</category>
      <category>abtesting</category>
      <category>experimentation</category>
    </item>
    <item>
      <title>How do you run A/B split tests or experiments on your sites?</title>
      <dc:creator>Robert Kingston</dc:creator>
      <pubDate>Sat, 09 Nov 2019 11:40:59 +0000</pubDate>
      <link>https://dev.to/kingo55/how-do-you-currently-run-a-b-split-tests-or-experiments-on-the-sites-you-work-on-opj</link>
      <guid>https://dev.to/kingo55/how-do-you-currently-run-a-b-split-tests-or-experiments-on-the-sites-you-work-on-opj</guid>
      <description>&lt;p&gt;Please share how you're currently running experiments on your sites. E.g.:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What software you're using&lt;/li&gt;
&lt;li&gt;Whether you build experiments in JS, backend code, WYSIWYG or CMS UIs&lt;/li&gt;
&lt;li&gt;Who typically manages this process&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm curious to learn how other developers and organisations run experiments because we're building an &lt;a href="https://mojito.mx/"&gt;open source split testing stack&lt;/a&gt;, called Mojito. It'd be useful to know what sort of features and use cases are common to target!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>splittesting</category>
      <category>abtesting</category>
      <category>testing</category>
    </item>
  </channel>
</rss>
