chameleon-mvt

2.30.0 • Public • Published

Chameleon MVT Framework?

This utility provides the ability to run MVT tests when Google Optimise may not be suitable.

It was created from the necessity to execute some code synchronously before other scripts have executed.

Confluence

Your first port of call would be to take a look at This confluence page HERE

There are many steps and the confluence page will guide you all the way through set-up to releasing your experiments.


How do I get set up?

  • Create js file in src/mvts directory
  • Configure mvt object
  • Include your mvt in array of available mvts
  • Activate via section parameter

Create js file in src/mvts directory

As a convention, name this file by the jira number e.g.

/src/mvts/JIRA-123.js

Configure mvt object

export default {
    id: 'JIRA-123',
    pageType: pageTypes.ARTICLE,
    variants: [
        {
            traffic: 50,
            code: function() {
                window.console.log('original');
            }
        },
        {
            traffic: 50,
            code: function() {
                window.console.log('variant 1');
            }
        }
    ]
};

Include your mvt in /src/js/index.js

import JIRA123 from '../mvts/JIRA-123.js';
...
const availableTests = [JIRA123];

Activate via section parameter

feature.mvtTests.enable=true feature.mvtTests=["JIRA-123"]

When the MVT test is active, clients will be randomly segmented. The variant information will be stored in a cookie. This cookie name will be the the mvt id and the value will be the variant e.g. JIRA-123=1

Readme

Keywords

none

Package Sidebar

Install

npm i chameleon-mvt

Weekly Downloads

1

Version

2.30.0

License

ISC

Unpacked Size

757 kB

Total Files

212

Last publish

Collaborators

  • reach-ci