reywood / meteor-iron-router-ga

Google analytics for Iron Router
MIT License
75 stars 22 forks source link

Server side route tracking #4

Open perak opened 10 years ago

perak commented 10 years ago

Hi Sean,

Is that possible to track server side routes?

Thank you!

reywood commented 10 years ago

Hi. I don't believe Google Analytics provides a way to do this. If you know different, I'd be interested to hear about it.

perak commented 10 years ago

OK. Thank you for your answer.

perak commented 10 years ago

Maybe "node-ga" module can help - I made simple node server and it works (I'l try that later in meteor)

var http = require("http");
var ga = require("node-ga")('UA-XXXXXXXX-X', { safe: true});

var server = http.createServer(function(req, res) {
    return ga(req, res, function () {

        res.writeHead(200, {"Content-type": "text/html"});
        res.end("<h1>Hello world!</h1>\n");
    });
}).listen(80);
meule commented 9 years ago

@perak Hi! Did you realize it in Meteor? )

perak commented 9 years ago

Hi,

No, I didn't - but I even didn't try - I am counting number of downloads by incrementing collection field - without ggogle analytics

On Fri, Dec 19, 2014 at 9:43 AM, Konstantin Varik notifications@github.com wrote:

@perak https://github.com/perak Hi! Did you realize it in Meteor? )

— Reply to this email directly or view it on GitHub https://github.com/reywood/meteor-iron-router-ga/issues/4#issuecomment-67611838 .

erkkaha commented 9 years ago

Hi,

I needed some server side analytics as well and seems that this could be achieved with universal-analytics npm package (https://www.npmjs.com/package/universal-analytics). I made a initial integration in https://github.com/erkkaha/meteor-iron-router-ga If pull requests on this are welcome I could propably extend this a bit and make one.