Skip to content

Instantly share code, notes, and snippets.

@bill-barron
Last active December 14, 2015 01:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bill-barron/5007839 to your computer and use it in GitHub Desktop.
Save bill-barron/5007839 to your computer and use it in GitHub Desktop.
Modernizr-Analytics
/***************************************************************************
* 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