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
+5 -2
View File
@@ -5,7 +5,7 @@
var async = require('async');
var fs = require ('fs');
var indexController = function(req, res) {
var indexController = function(req, res, googleAnalyticsId) {
'use strict';
async.parallel({
@@ -15,8 +15,11 @@ var indexController = function(req, res) {
}
}, function(err, results) {
var html = results.htmlTemplate;
html = html.replace('%%GA_ID%%', googleAnalyticsId);
res.setHeader('Content-Type', 'text/html');
res.send(results.htmlTemplate);
res.send(html);
});
};