Google Analytics AB
Lib tool in javascript to create A/B tests using Google Analytics events in easy way. With a simple configuration you can edit your page and get metrics.
Getting started
NPM
To install using npm you must run.
$ npm i --save google-analytics-ab
And use require to get the lib.
var googleAnalyticsAB = ; # Or with ecma6
Bower
To install using Bower you must run.
$ bower install google-analytics-ab
You can get in folder dist the compressed file (/dist/google-analytics-ab.min.js
).
Dependencies
- Google Analytics script (obvios?)
Create your own first test
You must have GA script in your page.
To make a simple test, you can call:
..........
# Example of AB change button color Green or Red googleAnalyticsAB;
How to see the results
Open your Google Analytics account and go to:
Behavior > Events > Overview
In Event category, go to googleAnalyticsAB
.
Click in Event Action
.
Now, you will see all A/B tests running. Click in your current A/B test.
Now, you will see your options, check all and click in Plot rows
.
See your test result :D
Ps: If you cannot see the events, you need change the date and add the current day.
Bugs? Tacnoman <renatocassino@gmail.com>
.