Git Product home page Git Product logo

radiant-metrics-extension's Introduction

Metrics

This extension enables metrics and A/B testing using the Vanity library (vanity.labnotes.org).

Upgrade

Note that this version is incompatible with the metrics data from the previous version if the bundled Vanity gem was used. Vanity is no longer bundled with the extension and must be installed separately.

Installation

Place the files for this extension within vendor/extensions/metrics in your Radiant application, and restart your server.

Via git clone:

git clone git://github.com/jemmyw/radiant-metrics-extension.git vendor/extensions/metrics

Via extension script:

script/extension install metrics

Run ‘rake gems` after installation for required gems.

Now run:

  • rake radiant:extensions:metrics:migrate

  • rake radiant:extensions:metrics:update

Configuration

The Vanity gem requires Redis (code.google.com/p/redis/) to be running as a datastore. Alternatively a version of Vanity with ActiveRecord support is available at github.com/jemmyw/vanity

Using page tags for metrics and A/B tests

Create metrics and A/B tests under the new metrics tab in the Radiant admin.

Now you can do the following on your pages:

<r:track name="Signup" />

This will increment a metric named Signup.

<r:ab:test name="homepage test">
  <r:a>Half your users will be shown this text</r:a>
  <r:b>The other half will be shown this text</r:b>
</r:ab:test>

This will run the A/B test named “homepage test”. Under the metrics dashboard tab you will see the results for the test.

Note: using <r:track> or <r:ab:test> will switch off caching for that page.

Using A/B test pages

You can run an A/B test by creating a new page of the type AbTest. This will alternatively display the first two children of the page in it’s place.

Using Javascript for metrics

You can also track metrics via Javascript. Using the Javascript tracking allows the page to be cached. Include the following in your layout:

<script type="text/javascript" src="/javascripts/metrics-min.js"></script>

Now you can track a metric via AJAX javascript calls:

<a href="http://example.com/signup" onclick="Metrics.track('signup');">Sign up now!</a>

radiant-metrics-extension's People

Contributors

jemmyw avatar

Watchers

rosa maria palacios juncosa avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.