Skip to content

A snippet for OU Campus to have A/B testing in content push to Google Analytics

License

Notifications You must be signed in to change notification settings

jessgusclark/snippet-ab-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snippet-ab-testing

This snippet allows a content users in OU Campus to add different variations of content to test. On page load, the javascript (via jQuery) chooses a variation at random to display to the user. If Google Analytics is loaded on the page it will set custom dimension 1 to the variation number.

This project is very much a work in progress and will probably change as time goes on. Don't trust this will production data yet, this is still in development.

Install

Create a custom dimension in Google Analytics. Currently the script is hardcoded to dimension 1.

Publish js/ab-test.js to your webserver. Import xsl/snippet-abtest.xsl into an existing stylesheet and change link to ab-test.js to go to your published version of the file. Add snippet-abtest.html to your sinppets directory (probably /_resources/ou/snippets) and register the snippet with OU Campus.

Contribute

Feel free to contribute via fork and pull requests; there is plenty of room for improvement.

About

A snippet for OU Campus to have A/B testing in content push to Google Analytics

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published