I recently ran into an interesting issue in Google Analytics – I wanted to track an event and then immediately direct the browser to a different page. Easy right?
The problem was when the event tracking was implemented like this…
One last thing to consider at this point – now the browser navigation function is reliant on the Google Analytics object to be present. It would probably be a good idea to check the availability of GA and account for folks who have blocked it or otherwise don’t have the object available.
Something like the following should produce the desired result:
Thanks to everyone who made the 2013 50/50 Boxpool Fundraiser a huge success! With your help we were able to sell all 100 boxes and raise $1,500 for Hurricane Sandy relief efforts.
Congratulations to the winners
First Quarter – S. Khan
Half – S. Dilkes
Third Quarter – J. O’Briant
End of Game – T. Mauseth
How you helped Staten Island in their relief effort
A huge thanks to Mike Hassell for coordinating with Occupy Sandy in Staten Island to purchase the most needed items off of the Amazon wishlist. Here’s what was purchased:
jQuery’s native slideToggle function generates an undesirable effect when applied to a DOM element containing absolutely positioned children landing on or outside the parent’s boundaries. At the outset of the animation jQuery hides the overflow of the animating element. This will appear to”snap off” or “clip” any portion of any child element hanging outside of the borders of the parent.
As you can see as soon as the animation starts the overlay of the element becomes hidden – appearing to cut off the portion of the absolutely positioned elements which land outside the boundaries of the parent.
To handle this issue more gracefully I’ve written a slideToggle extension which checks for offending children and quickly fade them out before commencing the sliding effect.
The result is a bit less jarring. See an example with the slideToggle extension here: http://jsfiddle.net/LFer9/1/
Today I ventured into the land of namespaced events in jQuery. I required the ability to remove a specific click event bound to an element without unbinding all of the element’s click events.
An event name can be qualified by event namespaces that simplify removing or triggering the event. For example, “click.myPlugin.simple” defines both the myPlugin and simple namespaces for this particular click event. A click event handler attached via that string could be removed with .off(“click.myPlugin”) or .off(“click.simple”) without disturbing other click handlers attached to the elements.
That’s pretty sick. Let’s try it.
First a couple of HTML buttons
The jQuery
$(document).ready(function(){
$("#button").on("click", function(){ //not namespaced
console.log('generic click');
});
//namespace an event by appending a "." + string value to the action
$("#button").on("click.myAction",function(){
console.log('myAction namespace');
})
$("#removeAction").on("click",function(){
$("#button").off("click.myAction"); // remove the myAction event from #button
console.log('myAction removed!!');
});
});
Resulting in..
Upon loading this script in the browser the “click this” button will log ‘generic click’ and ‘myAction namespace’ to the console.
Clicking the “Remove myAction Namespace” removes the myAction namespace and logs ‘myAction removed!!’.
All further clicks on the “click this” button will result in only logging ‘generic click’.
Yesterday I discovered that the goal conversions in Google Analytics de-dupe on the user’s session.
The goal we set up to test was a URL destination goal type with a required step in the Goal Funnel. We required case sensitive, exact matching URLS to count for conversion success.
We set up a test in which we created 10 unique users with email addresses. We split the list into three sections and three people completed the funnel for each test goal in their list. Each tester used a different browser for each test user.
Tester 1
Tester 2
Tester 3
Goal 1 – Chrome
Goal 4 – Chrome
Goal 8 – Chrome
Goal 2 – IE
Goal 5 – IE
Goal 9 – IE
Goal 3 – Firefox
Goal 6 – Firefox
Goal 10 – Firefox
Goal 7 – safari
The original purpose of our testing was to understand how duplications were being handled across our various conversion tracking and lead generation platforms. With that in mind we filled out the goals again. In our effort to ensure no duplicate data Tester 2 took Tester 1′s test users, Tester 3 took Tester 2′s, and Tester1 took Tester 3′s.
Resulting in the following:
Tester 1
Tester 2
Tester 3
Goal 8 – Chrome
Goal 1 – Chrome
Goal 4 – Chrome
Goal 9 – IE
Goal 2 – IE
Goal 5 – IE (browser re-opened)
Goal 10 – Firefox
Goal 3 – Firefox
Goal 6 – Firefox
Goal 7 – safari
One thing to note: On the second round of tests – Tester 3 closed his Internet Explorer before running Goal 5. Other than that one browser session… all other browsers remained opened through both rounds of testing.
Guess how many conversion there were.
Personally I had expected to see either the number 10 or 20. Not 12. But after thinking about it – 12 is the number you derive if you de-dupe on the user’s session.
Green = Counted Goal
Red = Duplicate on Session
Tester 1 – round 1
Tester 2 – round 1
Tester 3 – round 1
Goal 1 – Chrome
Goal 4 – Chrome
Goal 8 – Chrome
Goal 2 – IE
Goal 5 – IE
Goal 9 – IE
Goal 3 – Firefox
Goal 6 – Firefox
Goal 10 – Firefox
Goal 7 – safari
Tester 1 – round 2
Tester 2 – round 2
Tester 3 – round 2
Goal 8 – Chrome
Goal 1 – Chrome
Goal 4 – Chrome
Goal 9 – IE
Goal 2 – IE
Goal 5 – IE (browser re-opened)
Goal 10 – Firefox
Goal 3 – Firefox
Goal 6 – Firefox
Goal 7 – safari
De-duping on user’s session we can see there were 12 goal conversions.