https://github.com/jessgusclark/snippet-ab-testing
A snippet for OU Campus to have A/B testing in content push to Google Analytics
https://github.com/jessgusclark/snippet-ab-testing
analytics googleanalytics oucampus xsl
Last synced: 3 months ago
JSON representation
A snippet for OU Campus to have A/B testing in content push to Google Analytics
- Host: GitHub
- URL: https://github.com/jessgusclark/snippet-ab-testing
- Owner: jessgusclark
- License: mit
- Created: 2018-01-16T21:03:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-30T22:42:25.000Z (over 8 years ago)
- Last Synced: 2025-02-23T17:26:07.934Z (over 1 year ago)
- Topics: analytics, googleanalytics, oucampus, xsl
- Language: XSLT
- Homepage: http://www.unco.edu/jesse/ab-testing/
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.