ruby on rails - With Omniauth, How to record all requests for authentication? -


with omniauth in app, have user use google oauth2 authenticate redirect user to:

/users/auth/google_oauth2 

if users approves request, authenticationscontroller#create called.

with authenticationscontroller#create - can add event tracking record # of users approve google auth. don't have number sent approve meaning don't have conversion rate.

how can track # of people hit url around making requests connect.

a nasty solution build filter around method strategy#request_call , tracking there.

inside initializer:

omniauth::strategy.class_eval   def request_call_with_tracking     log :info, "im running before actual request_call"     tracker.hit(name) #name return provider     request_call_without_tracking   end   alias_method_chain :request_call, :tracking end 

Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -