Skip to content

Commit

Permalink
Enable GA and AddThis after window load
Browse files Browse the repository at this point in the history
  • Loading branch information
formulahendry committed Sep 25, 2016
1 parent 7400d20 commit e9f2f9c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
26 changes: 17 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,29 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="./src/favicon.ico">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<title>Visual Studio Code Extension Download Count</title>
</head>
<body>
<div id="root"></div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
window.onload = function() {
// GA
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-84677857-1', 'auto');
ga('send', 'pageview');
ga('create', 'UA-84677857-1', 'auto');
ga('send', 'pageview');

// AddThis Widget
var script = document.createElement('script');
script.src = '//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-57e679eabcef18e0';
script.type = 'text/javascript';
script.async = true;
document.getElementsByTagName('body')[0].appendChild(script);
};
</script>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<!--<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-57e679eabcef18e0"></script>-->
</body>
</html>
3 changes: 3 additions & 0 deletions src/components/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ class Home extends Component {
return (
<div className="Home">
<h1>Extensions List</h1>
<p>
Not see your extension? Send a PR <a href="https://github.com/formulahendry/vsce-website/blob/master/src/assets/extensions.json">here</a>, or submit a <a href="https://github.com/formulahendry/vsce-website/issues">request</a>.
</p>
{extensions.map((extension, index) =>
<div key={extension}>
<Link to={`/history/${extension}`}>{extension}</Link>
Expand Down

0 comments on commit e9f2f9c

Please sign in to comment.