lunametrics/youtube-google-analytics — pull request #4 by jamesryanbell (2014-04-22 08:50:51+00:00)
Title: Detection of Universal and Classic Google Analytics and bug fix

Detection of Universal and Classic Google Analytics is done at the top of the script and then according to the results the correct type of tracking is used. This could be none, both or either of the two variants.

Modified the jQuery call so that only iframes containing youtube within the src will be checked (https://github.com/lunametrics/youtube-google-analytics/issues/2#issuecomment-40663846). Also added some backup type checking on the SourceCheckA if statement as this was crashing the script when applied to iframe that didn't have youtube url as src. This is a little bit overkill but prevents the script taking out all subsequent JavaScript on the page if there is an error.