Skip to content

Commit 3ece396

Browse files
committed
Update GA and Twitter Widget code snippets
1 parent 2d9951d commit 3ece396

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

index.html

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -91,28 +91,17 @@ <h2 class="tagline">A modern, HTML5-ready alternative to CSS resets</h2>
9191
</div>
9292

9393
<script>
94-
window._gaq=[['_setAccount','UA-7489188-1'],['_trackPageview']];
95-
(function(doc, script) {
96-
var js,
97-
fjs = doc.getElementsByTagName(script)[0],
98-
frag = doc.createDocumentFragment(),
99-
add = function(url, id) {
100-
if (doc.getElementById(id)) {return;}
101-
js = doc.createElement(script);
102-
js.src = url;
103-
id && (js.id = id);
104-
frag.appendChild(js);
105-
};
94+
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
95+
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
96+
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
97+
e.src='//www.google-analytics.com/analytics.js';
98+
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
99+
ga('create','UA-7489188-1');ga('send','pageview');
106100

107-
// Google Analytics
108-
add(('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js');
109-
// Google+ button
110-
add('http://apis.google.com/js/plusone.js');
111-
// Twitter SDK
112-
add('http://platform.twitter.com/widgets.js', 'twitter-wjs');
113-
114-
fjs.parentNode.insertBefore(frag, fjs);
115-
}(document, 'script'));
101+
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];
102+
if(!d.getElementById(id)){js=d.createElement(s);js.id=id;
103+
js.src="https://platform.twitter.com/widgets.js";
104+
fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
116105
</script>
117106

118107
</body>

0 commit comments

Comments
 (0)