-
-
Save zerostyle/5036984 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(window.addEventListener) { // correlates with media query support | |
var timer = false | |
, resize_monitor = function() { | |
if(timer) { | |
clearTimeout(timer); | |
} | |
timer = setTimeout(function() { _gaq.push(['_trackEvent', 'Resize', 'Resize', 'Resized']); }, 100); | |
// or log a pageview on a non-existant page if you prefer | |
// timer = setTimeout(function() { _gaq.push(['_trackPageview', '/resized.html']); }, 100); | |
} | |
; | |
window.addEventListener('resize', resize_monitor, false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment