kangguru / rack-google-analytics

Simple Rack middleware for implementing google analytics tracking in your Ruby-Rack based project. Supports synchronous and asynchronous insertion and configurable load options
MIT License
257 stars 53 forks source link

New feature: make the tracking code environment dependent #3

Closed cimm closed 14 years ago

cimm commented 14 years ago

I missed one little feature in this app: environment dependency. I like to show the tracking code only in my production environment as I don't want to count the hits I'm generating while developing or testing.

I added an extra parameter where you can specify the environment if you are interested: http://github.com/cimm/rack-google-analytics/commit/e505150d3bbd6dd4a72d8e7147d5b415fed94954 It uses an :env => "development" parameter and will default to the production environment when nothing is given.

I'll do a new pull request so you can include it in the master... if you like it.

cimm commented 14 years ago

These changes have been merged in the master, thanks Lee.

rhb commented 12 years ago

I didn't see this in master, did it get merged in? Also - is there any way to disable the google-analytics insertion for specific namespaces? For example - if I don't want to track traffic to my /admin pages?