Skip to content

Instantly share code, notes, and snippets.

@tomlane
Forked from bill-barron/Modernizr.Analytics.js
Created February 22, 2013 19:01
Show Gist options
  • Save tomlane/5015733 to your computer and use it in GitHub Desktop.
Save tomlane/5015733 to your computer and use it in GitHub Desktop.
/***************************************************************************
* 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