Reputation: 5
I am creating a website for booking hotels, I want to be able to keep track of when people try to search, but end up not doing so. Any suggestions on how to do this? I considered creating a model which was UnfinishedSearch and would be created if they begin the search process, and deleted if they actual book a hotel...Any better ideas?
(Reason I want this information is to be able to send an email to the user asking them for feedback in case they didn't finish)
Upvotes: 0
Views: 54
Reputation: 1478
It depends how much data you want to retain about the abandoned search. If you want to keep information like the search query, time, ect then creating a new model is probably the best approach. Create a new record (associated to the user) when the search process begins. You can record information about the search as the user continues through the search process.
On the other hand, if you just want a tally of the number of abandoned searches, then you could add a new attribute to the user model to record the number of abandoned searches for each user.
I prefer the first approach because you can record more information and nicely timestamp the abandoned searches.
Upvotes: 1