Skip to content

Conversation

@kingo55
Copy link

@kingo55 kingo55 commented Mar 6, 2013

Hey James,

Excellent script you have here. I'm going to make a few changes, this is the first. The event tracking used to affect the bounce rate metric. Now it does not.

Have also started a blog post about this. I bet my readers will love this.

Rob

The event tracking used to affect the bounce rate metric. Now it does not.
lib/cohorts.js Outdated
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have double commas here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because we're not passing a value to opt_value for the track event function. We need to send "true" to int_hit, though. See opt_noninteraction here: https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide

What do you suggest here, James?

kingo55 added 5 commits March 9, 2013 13:26
Under storage adapter, I have added the custom variable slot and setCustomVar function.

Under the test object, I have created a new variable called scope. I intend to make this work with a cookie function. i.e. depending on the scope (1: visitor, 2: session, 3: page), the cookies will persist for that particular scope.
Have included the following new features:

* Custom variable tracking
* Setting the test's scope (e.g. persist cookies for page, session or visitor lifetime)
* Removed a bunch of code not in use
* Made it mandatory to include a storage adapter with each experiment
Have included the following in this update:

* Custom variable tracking
* Setting the test's scope (e.g. persist cookies for page, session or visitor lifetime)
* Removed a bunch of code not in use
* Made it mandatory to include a storage adapter with each experiment
README.textile Outdated
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason you aren't just using the google analytics adapter?

@jamesyu
Copy link
Owner

jamesyu commented Mar 10, 2013

there are a bunch of issues with this pull request - specifically, i would like to keep the google analytics adapter as is.

@kingo55
Copy link
Author

kingo55 commented Mar 10, 2013

Thanks for the feedback, James.

I'll see about fixing those issues up. In retrospect removing the storage
adapter wasn't the brightest move. I will, however need to define the
custom variable slot number (cv_slot) when creating the test object.

As far as the way I'm which the experiment scope is defined (persisting
over the duration of a visitor, session or page view), are you happy with
that? I figure this kills two birds with one stone. We can set the cookie
expiry and set the scope of the custom variable in one go.
On 11/03/2013 8:11 AM, "James Yu" notifications@github.com wrote:

there are a bunch of issues with this pull request - specifically, i would
like to keep the google analytics adapter as is.


Reply to this email directly or view it on GitHubhttps://github.com//pull/2#issuecomment-14689361
.

@jamesyu
Copy link
Owner

jamesyu commented Mar 10, 2013

Yep, I like the scoping, that's very useful.

@kingo55
Copy link
Author

kingo55 commented Mar 14, 2013

Thanks again for the feedback, James. I've made some commits to address your suggestions and add a little more polish to my work. I'm really enjoying using the script and running experiments across a number of my sites.

Anyway, does the script look sufficient to you now?

Blog post about cohorts.js
Also of interest, you may like to see the blog post I wrote about the project (of course, when the main project includes the updates, I'll switch the the link back):

http://www.optimisationbeacon.com/testing/using-cohorts-js-an-open-source-javascript-ab-mvt-library/

Of particular interest, I suggest a number of improvements which could add some additional value to the framework.

kingo55 added 10 commits March 24, 2013 19:16
Preview mode should run irregardless of the sample size. This is what you would expect to see in a preview mode.
Adding loads of new features to the test object:

- User agent match
- Cookie match
- Referrer match
- URL match (for A/B URL redirects)
- DOM Ready function to ensure code runs as soon as all elements exist in the DOM
- Also made some cosmetic changes to the GA code
cclafferty and others added 18 commits August 25, 2013 16:39
The referrer array is queried even when it's empty. Other filters ignore
empty arrays, so this fix is more for consistency.
Fixes referrer being matched when passed an empty array
Fixing typo in UA detection for ios devices
Had an unnecessary comma in there after the User Agent blocking
Fine tune the percentage of visitors allocated to each cohort. I.e. Control: 20%, Treatment: 80%
implement Visitor must not be allowed in the test now or in the future,
when Excluded by sample parameter.
Add 'New to this test' feature
Updating storage adapter to pass newToTest into datalayer
1. rewirte Cookies object, small and faster
2. remove unused functions(inChort, Util.size)
3. other minor changes to improve the performence
Optimisations to the Cohorts library from David.

Thanks, @allmywant!
Updated values
name -> "name"
scope -> "testScope":"user" // Values should include "user", "session"
and "hit". Default should be "user" if this variable is not set.
varSlot -> "analyticsSlot"
sample -> "sampleRate"
urlMatch -> "targetURL"
uaBlock -> "userAgentExclude"
cookieMatch -> "cookieMatch"
referrerMatch -> "referrerMatch"
cohorts -> "cohorts"

URL match object
regex -> "expression": /^\/store\/tyres\/.*/i,
regexType -> "match":"pathname|href"
Redefining variable names in test object
support same simpleRate values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants