kissmetrics

Execute JS code on user sign up/sign in with Rails + Devise

佐手、 提交于 2019-12-05 22:58:46
I'm looking at the Kissmetrics (analytics app) JS API docs, and they have an "identify" method that lets you tell Kissmetrics about a user. Here's what their docs say: We recommend you call identify in two scenarios: When a user successfully signs up When a user successfully logs in, either through cookies or through a login page What would be the best way to achieve that? How can I detect when a user has just signed up or signed in? Lets divide the problem in two: register and log in. You can detect when a new user has registered in you app just adding a after_create hook in you User model.