Update GA and Twitter Widget code snippets

This commit is contained in:
Nicolas Gallagher 2013-08-16 20:51:06 -07:00
parent 2d9951d89a
commit 3ece396d56

View File

@ -91,28 +91,17 @@
</div>
<script>
window._gaq=[['_setAccount','UA-7489188-1'],['_trackPageview']];
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
frag = doc.createDocumentFragment(),
add = function(url, id) {
if (doc.getElementById(id)) {return;}
js = doc.createElement(script);
js.src = url;
id && (js.id = id);
frag.appendChild(js);
};
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='//www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-7489188-1');ga('send','pageview');
// Google Analytics
add(('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js');
// Google+ button
add('http://apis.google.com/js/plusone.js');
// Twitter SDK
add('http://platform.twitter.com/widgets.js', 'twitter-wjs');
fjs.parentNode.insertBefore(frag, fjs);
}(document, 'script'));
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];
if(!d.getElementById(id)){js=d.createElement(s);js.id=id;
js.src="https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
</script>
</body>