Last active
December 14, 2015 01:39
-
-
Save bill-barron/5007839 to your computer and use it in GitHub Desktop.
Modernizr-Analytics
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
/*************************************************************************** | |
* FeatureLogger - Saves features detected by Modernizr to google analytics | |
***************************************************************************/ | |
(function () { | |
var _gaq = _gaq || [], | |
Modernizr = Modernizr || {}; | |
for(testName in Modernizr) // For every Modernizr test | |
if(typeof Modernizr[testName] === 'boolean') // If it is a boolean | |
_gaq.push(['_trackEvent', 'modernizr', testName, ((Modernizr[testName]) ? 'Yes' : 'No')]); // Log a yes or no | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment