-
Notifications
You must be signed in to change notification settings - Fork 33
Updated the Google Analytics tracking for a non-interaction hit #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The event tracking used to affect the bounce rate metric. Now it does not.
lib/cohorts.js
Outdated
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
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
There was a problem hiding this comment.
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?
|
there are a bunch of issues with this pull request - specifically, i would like to keep the google analytics adapter as is. |
|
Thanks for the feedback, James. I'll see about fixing those issues up. In retrospect removing the storage As far as the way I'm which the experiment scope is defined (persisting
|
|
Yep, I like the scoping, that's very useful. |
Also defining cv_slot within the test object rather than the storage adapter object.
No real need for this in here.
|
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 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. |
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
Lots of small little tweaks here and there.
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
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