rack-google-analytics icon indicating copy to clipboard operation
rack-google-analytics copied to clipboard

How do you exclude directories from google analytics?

Open AlexCppns opened this issue 11 years ago • 9 comments

AlexCppns avatar Dec 03 '13 16:12 AlexCppns

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

kangguru avatar Dec 03 '13 16:12 kangguru

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?

SeriouslyAwesome avatar Dec 03 '13 17:12 SeriouslyAwesome

@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.

AlexCppns avatar Dec 03 '13 18:12 AlexCppns

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?

kangguru avatar Dec 03 '13 20:12 kangguru

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

AlexCppns avatar Dec 03 '13 20:12 AlexCppns

I agree that it would be really useful !

oTiMo avatar Feb 20 '14 16:02 oTiMo

Pull request #38 works fine for that:

if: lambda { |env| env['PATH_INFO'] !~ %r{/admin} }

sigmike avatar Mar 10 '14 17:03 sigmike

+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.

mhuggins avatar Feb 17 '15 17:02 mhuggins

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

kangguru avatar Mar 06 '15 07:03 kangguru