├── logo.png ├── modules.png ├── reports.png ├── LICENSE └── README.md /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mint-metrics/mojito/HEAD/logo.png -------------------------------------------------------------------------------- /modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mint-metrics/mojito/HEAD/modules.png -------------------------------------------------------------------------------- /reports.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mint-metrics/mojito/HEAD/reports.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2019, Mint Metrics Pty Ltd 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Mojito experimentation framework

2 | 3 | # Mojito 4 | 5 | A modular, source-controlled split testing framework that lets you build, launch and analyse experiments via Git/CI. 6 | 7 |

View documentation | Read intro blog post

8 | 9 | It's comprised of 3 core modules e.g.: 10 | 11 | 1. **[Mojito JS Delivery](https://github.com/mint-metrics/mojito-js-delivery)**: Front-end library for running experiments on your site. 12 | 2. **[Mojito Snowplow Storage](https://github.com/mint-metrics/mojito-snowplow-storage)**: Data models & events for tracking experiments. 13 | 3. **[Mojito R Analytics](https://github.com/mint-metrics/mojito-r-analytics)**: Templatable RMarkdown experiment reports. 14 | 15 | ![Mojito's 3 components](modules.png) 16 | 17 | ## Features 18 | 19 | - Under 5kb minified & gzipped 20 | - Define experiments with simple JS or YAML 21 | - Self-hosted & git-controlled for familiar code review / merging 22 | - Expressive trigger system & utilities 23 | - Variant code (JS/CSS) minification & linting 24 | - Track and handle JS errors caused by your variant code 25 | 26 | ## Mojito vs. [vendor] 27 | 28 | Differentiating features between popular vendors' tools and Mojito out of the box: 29 | 30 | Feature | Optimizely X | Google Optimize | Mojito 31 | --- | --- | --- | --- 32 | Open-source license | ❌ | ❌ | ✅ BSD3 33 | Light front-end codebase * | ❌~80kb | ❗~25kb | ✅<5kb 34 | Git source control & CI | ❌ | ❌ | ✅ 35 | Variant error-tracking/handling | ❌ | ❌ | ✅ 36 | Auto CSS/JS minification | ❗([not custom code](https://community.optimizely.com/t5/Using-Optimizely/Minified-version-of-Optimizely-X-snippet/m-p/21411#M8655)) | ❓ | ✅ 37 | Self-hosted | ❗ (for a fee) | ❗(via API) | ✅ 38 | Data ownership | ❗(via S3 export) | ❗(via 360/BigQuery) | ✅ 39 | Retroactively add new metrics | ✅ | ❗(360 only) | ✅ 40 | Server-side/App testing | ✅ | ❗(via API) | ❗(via **Storage**) 41 | WYSIWYG test editor | ✅ | ✅ | ❌ 42 | 43 | \* Tested 2019-07-05 44 | 45 | ## Getting started 46 | 47 | Mojito consists of three components, which are often switched out in the course of Mint Metrics' client services: 48 | 49 | 1. **Delivery**: Front-end libraries to reliably control which treatments users are exposed to. e.g. [Mojito JS Delivery](https://github.com/mint-metrics/mojito-js-delivery) 50 | 2. **Storage**: Data collection modules and data modelling steps to power your reports. e.g. [Mojito Snowplow Storage](https://github.com/mint-metrics/mojito-snowplow-storage) 51 | 3. **Analytics**: Tools to measure & report on the effects caused by your treatments. e.g. [Mojito R Analytics](https://github.com/mint-metrics/mojito-r-analytics) 52 | 53 | Get up and running quickly with the README files inside each section. 54 | 55 | ## Example experiment 56 | 57 | Using Mojito's CI tools, you can set up experiments in YAML & JS: 58 | 59 | ```{yaml} 60 | id: ex1 61 | name: Example test 1 62 | state: live 63 | sampleRate: 0.75 64 | trigger: trigger.js 65 | recipes: 66 | 0: 67 | name: Original 68 | 1: 69 | name: Variant 70 | js: variant.js 71 | css: variant.css 72 | ``` 73 | 74 | Where ```trigger.js``` activates the experiment when a condition is met and a callback to activate is fired: 75 | 76 | ```{js} 77 | function trigger(test) { 78 | if (document.location.pathname === '/') test.activate(); 79 | } 80 | ``` 81 | 82 | Upon activation, the will include 75% of traffic (```sampleRate: 0.75```) and split it 50-50 between "Original" and "Variant" groups. 83 | 84 | For users assigned to the "Variant" group, we execute **a)** ```variant.js``` and **b)** ```variant.css``` files to transform the page through a **a)** JS function and **b)** CSS stylesheet respectively. 85 | 86 | ### After you've defined an experiment YAML... 87 | 88 | Run the Gulp pipeline to lint/test/publish your container. 89 | 90 | 1. Install the necessary NPM packages: ```npm install``` 91 | 2. Build & publish your testing container: ```gulp scripts-local && gulp publish``` 92 | 93 | ## Example analytics reports 94 | 95 | If you use our Snowplow/Redshift & R Analytics component for reporting, all your metrics can be reported on with a simple array of metrics. 96 | 97 | ```{r} 98 | wave_params <- list( 99 | client_id = "mintmetrics", 100 | wave_id = "ex1", 101 | start_date = "2019-05-15 09:19:45", 102 | stop_date = "2019-06-05 14:29:00", 103 | time_grain = "hours", 104 | subject = "usercookie", 105 | recipes = c("Original", "Variant") 106 | ) 107 | 108 | goalList <- list( 109 | list( 110 | title = "Transactions", 111 | goal = "purchase", 112 | operand = "=" 113 | ), 114 | list( 115 | title = "Thankyou page views", 116 | goal = "page_view /contact/thank-you%", 117 | operand = "like" 118 | ) 119 | ) 120 | goalList <- mojitoFullKnit(wave_params, goal_list = goalList) 121 | ``` 122 | 123 | For this experiment, we'll report on transactions and page views: 124 | 125 | ![Measuring the performance of a treatment relative to the control group in Mojito.](reports.png) 126 | 127 | ## Support for other analytics back-ends 128 | 129 | You don't exactly need Snowplow Analytics to use Mojito. You can also track experiments to wherever you like, via a custom storage adapter. E.g. To Google Tag Manager, Adobe etc. 130 | 131 | You can even [hook Mojito Delivery up to Google Optimize's reports for free](https://mintmetrics.io/web-analytics/track-your-optimizely-vwo-tests-inside-google-optimize/). 132 | 133 | ## Credits 134 | 135 | Our **Delivery** JS library is a heavily modified fork of the excellent [jamesyu/cohorts](https://github.com/jamesyu/cohorts) lib. Meanwhile we employ heavy use of the [Snowplow Analytics event pipeline](https://snowplowanalytics.com/) for our **Storage** component and [RStudio/Knitr](https://rmarkdown.rstudio.com/) for our **Analytics** reports. 136 | 137 | 138 | ## Getting involved 139 | 140 | We would love to see PRs! We're able to assist if you hit any snags getting set up. 141 | 142 | Reach out to us via: 143 | 144 | - [Mint Metrics' website](https://mintmetrics.io/) 145 | - [Open an issue on Github](https://github.com/mint-metrics/mojito/issues/new) 146 | 147 | ## Learn more 148 | 149 | [Read the documentation](https://mojito.mx/) and get Mojito set up. We recommend starting with **Mojito JS Delivery**. 150 | --------------------------------------------------------------------------------