public
Last active

Modernizr-Analytics

  • Download Gist
Modernizr.Analytics.js
JavaScript
1 2 3 4 5 6 7 8 9 10
/***************************************************************************
* 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
})();

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.