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

How do you exclude directories from google analytics? #32

Open AlexCppns opened 10 years ago

kangguru commented 10 years ago

what do you mean exactly? can you give an example what your use case is looking like?

SeriouslyAwesome commented 10 years ago

I have a similar need. Not sure about @AlexCppns's situation, but I want to track only the public-facing pages of my app, and not necessarily the pages in my admin area. Anyway to disable tracking for certain actions?

AlexCppns commented 10 years ago

@kangguru I don't want it to be initialized in /admin for instance. For now I am using another gem that lets me insert the js only in the layouts I want.

kangguru commented 10 years ago

alright i see. thats pretty much the same as @iamjohnellis describes. Currently there isn't such option, but i can imagine thats a use case for even more people. so we might add something like that in the future.

what gem are you using atm?

AlexCppns commented 10 years ago

@kangguru We re using google-analytics-rails right now. It's not in production yet though, we haven't tested it.

oTiMo commented 10 years ago

I agree that it would be really useful !

sigmike commented 10 years ago

Pull request #38 works fine for that:

if: lambda { |env| env['PATH_INFO'] !~ %r{/admin} }
mhuggins commented 9 years ago

+1, looks like #38 has been sitting around for over a year with no feedback from the maintainer. Not sure if this gem is still kept up to date or I should use an alternative.

kangguru commented 9 years ago

please consider Rack::Tracker as an alternative, which is the successor of this Gem