Created
March 25, 2013 10:20
-
-
Save maskingtape/5236206 to your computer and use it in GitHub Desktop.
HTML5 boilerplate google analytics script loader generalised to include the font loader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _gaq=[['_setAccount','UA-XXXXXXX-X'],['_trackPageview']], | |
WebFontConfig = { google: { families: [ 'Marvel::latin' ]}}; | |
(function(d,t){ | |
function addScript(p, url){ | |
var g=d.createElement(t),s=d.getElementsByTagName(t)[0]; | |
g.src=('https:'==location.protocol?p.s:p.n)+url; | |
s.parentNode.insertBefore(g,s); | |
} | |
addScript({ s: '//ssl', n: '//www'}, '.google-analytics.com/ga.js'); | |
addScript({ s: 'https', n: 'http'}, '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'); | |
}(document,'script')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment