I want to store url of user's referral website after sucessfull registration. In this case I can't use request.referer because user can visit few pages on my website before registration. But I need previous website url, for example http://google.com or http://facebook.com/somepage_id or whatever. I know that Google Analytics or Intercome can collect this data but I want something simple. Preferably without external APIs or libraries if this possible.
There is ruby gem called 'ahoy', which can be used for this.
When someone visits your website, Ahoy creates a visit with lots of useful information.
Please find the link for more information, Ahoy
When user reach your site create UserSession which will store request.referer also it has user_id. And during registration bind UserSession to created User by filling user_id. In this case you will get site from which user came + you can get some additional info from UserSession(user-agent, date, visited pages and etc.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With