This extension enables metrics and A/B testing using the Vanity library (vanity.labnotes.org).
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.
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.
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 <rtest> 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.
<a href="http://example.com/signup" onclick="Metrics.track('signup');">Sign up now!</a>