mirror of
https://github.com/necolas/normalize.css.git
synced 2024-12-25 15:14:19 +00:00
Update GA and Twitter Widget code snippets
This commit is contained in:
parent
2d9951d89a
commit
3ece396d56
31
index.html
31
index.html
@ -91,28 +91,17 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window._gaq=[['_setAccount','UA-7489188-1'],['_trackPageview']];
|
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
|
||||||
(function(doc, script) {
|
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
|
||||||
var js,
|
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
|
||||||
fjs = doc.getElementsByTagName(script)[0],
|
e.src='//www.google-analytics.com/analytics.js';
|
||||||
frag = doc.createDocumentFragment(),
|
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
|
||||||
add = function(url, id) {
|
ga('create','UA-7489188-1');ga('send','pageview');
|
||||||
if (doc.getElementById(id)) {return;}
|
|
||||||
js = doc.createElement(script);
|
|
||||||
js.src = url;
|
|
||||||
id && (js.id = id);
|
|
||||||
frag.appendChild(js);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Google Analytics
|
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];
|
||||||
add(('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js');
|
if(!d.getElementById(id)){js=d.createElement(s);js.id=id;
|
||||||
// Google+ button
|
js.src="https://platform.twitter.com/widgets.js";
|
||||||
add('http://apis.google.com/js/plusone.js');
|
fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
|
||||||
// Twitter SDK
|
|
||||||
add('http://platform.twitter.com/widgets.js', 'twitter-wjs');
|
|
||||||
|
|
||||||
fjs.parentNode.insertBefore(frag, fjs);
|
|
||||||
}(document, 'script'));
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
Reference in New Issue
Block a user