Closed augustocsmartins closed 4 years ago
Having the same issue - any ideas?
Edit: I'm sure this isn't great but a possible work around and seems to work fine -
In application_controller.rb
-
before_filter :ga_send_user_id
def ga_send_user_id
if user_signed_in?
tracker do |t|
t.google_analytics :parameter, { userId: current_user.id }
end
end
end
Hi,
I use Devise to Authentication and is not working to set user_id from lambda as the example.
user_id: lambda { |env| env['rack.session']['user_id'] }
Is there another way to setup user_id from current_user or something like it?