Skip to content

Instantly share code, notes, and snippets.

@tomlane
Forked from bill-barron/Modernizr.Analytics.js
Created February 22, 2013 19:01

Revisions

  1. @bill-barron bill-barron renamed this gist Feb 21, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @bill-barron bill-barron created this gist Feb 21, 2013.
    10 changes: 10 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,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
    })();