Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
How to use node-ga with routes instead of as a middleware. Based on the third example from ("Several callbacks may also be passed, useful for re-using middleware that load resources, perform validations, etc.")
var ga = require('node-ga')('UA-XXXXXXXX-Y', { safe: true});
/* your usual express options */
app.get('/logged-route', ga, LoggedRouteHandler);
app.get('/non-logged-route', NonLoggedRouteHandler);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.