DEV Community

Discussion on: Shopping cart state saved in database or cookie for guests?

Collapse
 
wolfiton profile image
wolfiton • Edited

Thanks, @chris-pardy for sharing your solution and explanation of why you would choose this road to solve the problem, but I have a question:

How would you get the user info if they don't have an account and also wouldn't this be considered invasive(breach on their trust and privacy) to add the user's interest to a database without their knowledge? (the product they have put in the cart)
Also for me, GDPR is a must because I live in Europe.

Collapse
 
chrispardy profile image
chris-pardy

How you capture email or other info is ultimately a question of what your site offers and how far you or your local laws are willing to go what it comes to sophisticated online tracking. I'm not an expert on GDPR but I believe if a user signed up for a newsletter (email only, no login) you could still use their session data to retarget them for an abbandoned cart. Using the cart data for internal analytics would be possible even without personal information, and I don't think violates the trust of your users especially if that data is anonymous.

I would also say that while building a shopping cart is pretty straightforward there are some gotchas, GDPR amongst them. You're almost always going to be better off going with an ecommerce platform than rolling your own.

Thread Thread
 
wolfiton profile image
wolfiton

I have some doubts regarding this practice.

Thanks for explaining a lot more about this method and also for offering some examples of how this can be implemented, I really appreciate it.

Thanks @chris-pardy