jamesyu / cohorts

A simple javascript multivariate testing framework
Other
255 stars 34 forks source link

Track cohort in _setCustomVar at Visitor level scope #3

Open kingo55 opened 11 years ago

kingo55 commented 11 years ago

Typically, most experimentation platforms will look at unique visitors and unique conversions. This is important because people may be influenced by a particular change in any one of their visit sessions to the site.

Basically, we need to update the storage adapter to capture this data:

_gaq.push(['_setCustomVar',{slot},{name},{value},{scope}],['_trackEvent'...]);

I suggest we allow for setting the {scope} and setting the {slot}. The name and the value can be pre-filled using the test parameters. Note it must be called before _trackEvent().

Full instructions are here: https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingCustomVariables

kingo55 commented 11 years ago

Note this also means we have to set cookie expiry for 2yrs or for just the session (depending on the scope we choose).