Add Google Analytics in production

This commit is contained in:
Gaël Métais
2014-09-04 19:23:28 +02:00
parent 20530f2cc0
commit e06d7f9798
10 changed files with 65 additions and 12 deletions
+11 -1
View File
@@ -1,7 +1,7 @@
<html>
<head>
<meta charset="utf-8">
<title>Javascript Spaghetti Profiler</title>
<title>Yellow Lab Tools - Results page</title>
<link rel="stylesheet" type="text/css" href="/public/styles/main.css">
<link rel="stylesheet" type="text/css" href="/public/styles/results.css">
<script src="/bower_components/angular/angular.min.js"></script>
@@ -275,6 +275,16 @@
var _phantomas_metadata = %%METADATA%%;
var GA_ID = '%%GA_ID%%';
if (GA_ID.length > 0 && window.location.host === 'yellowlab.tools') {
(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','//www.google-analytics.com/analytics.js','ga');
ga('create', GA_ID, 'auto');
ga('send', 'pageview');
}
</script>
</body>
</html>