grails (11) vaadin (11) meteor (6) java (4) elasticsearch (3) apple (2) centos (1) cloudbees (1) google analytics (1) gradle (1) heroku (1) javafx (1) javascript (1) jdbc (1) jug (1) logback (1) logging (1) mac os (1) management (1) mongodb (1) mongolab (1) mysql (1) twitter (1) ubuntu (1)

Tuesday, May 21, 2013

Meteor with Google Analytics

Trying to get Google Analytics working with Meteor framework is so much fun. It took me quite some after I got this wonderful view:

How to get there: that is the question which is answered in the following gist.

Create new template, so we can hook to Template.googleAnalytics.rendered function. So, when googleAnalytics template is rendered, we can call Google Analytics service.
Insert the template into the HTML page that should be reported to Google Analytics.
Implement the call to Google Analytics service as follows (just replace 'UA-111111-1' with your token).
Thanks to these two sources.
TextLab for Mac
Ultimate application to validate, clean and format JSON, XML, SQL, HTML.