Numerous Philanthropic Misanthropes

    @magnet.me/mm-experiments

    1.2.2 • Public • Published

    Magnet.me Logo

    mm-experiments

    Set of directives to integrate A/B testing in an Angular application.

    Usage with Google Experiments:

    app
    	.run((experiments, googleExperiments) => {
    		//Configure all the things
    		experiments.setVariationFactory('my-experiment', () => googleExperiments.getVariation('googleExperimentId'));
    	})
    	<div mm-experiment="my-experiment">
    		<h1 mm-variation="0">Stuff</h1>
    		<h1 mm-variation="1">Other stuff</h1>
    		<p>
    			Above is showing variation {{$variation}}
    		</p>
    	</div>

    Caveats

    Some experiment providers (e.g. Google Analytics) require you to send an additional request after loading the experiment

    This module only loads the experiment in the browser, but does not automatically send anything to your experiments provider. For example, Google Analytics requires that at least one hit is send to Google Analytics after loading the experiments. This module does not do that for you since this we do not know how you interact with Google Analytics (this is application specific) and therefore we cannot determine an appropriate action to take to send the hit to GA.

    Keywords

    none

    Install

    npm i @magnet.me/mm-experiments

    DownloadsWeekly Downloads

    2

    Version

    1.2.2

    License

    Apache-2.0

    Last publish

    Collaborators

    • magnet-me-owner